JohnSmith2344
JohnSmith2344

Reputation: 1

state several objects within tween trough as3?

            myTween = new Tween(t1, "alpha",None.easeNone,1,0,2,true);

how can i change t1 for 5 objects without adding more lines?

also is there way to use array like myobjects[a] = "object1", myobject[b] = "object2" ... etc. so i can just check for active object with

event.target

and substract this one from array and make this tweet apply to all except one thats clicked.

Upvotes: 0

Views: 492

Answers (1)

Chris
Chris

Reputation: 58312

By far the best Tween framework is greensock. To do what you are asking, simply do the following:

TweenMax.allTo(myObjects, 1, {alpha:2, ease:None.easeNone});

http://www.greensock.com/as/docs/tween/com/greensock/TweenMax.html#allTo%28%29

You'll have to download the framework, which is very lightweight. Greensock promote themselves on their ultra small size.

As for the second question, simply do this

myObjects.forEach(function(item:*, i:int, a:Array):void {
    if(item != event.target) {
        // do stuff for tweet
        trace(item); // outputs each item except event.target
    }
});

Upvotes: 1

Related Questions