How would I go about accessing the object I am moving with a tween through TweenEvent? or is this even possible? I think e.currentTarget will give me the tween object instead of the movieclip it is controlling, but I’m not sure.
Example:
var tweens:Array = new Array();
var aryObjects:Array = {mc1,mc2,mc3,mc4};
function someFunction():void
{
for(var i:int = 0; i < aryObjects.length; i++)
{
var tween:Tween;
tweens.push(tween);
}
}
function executeTweenFunction():void
{
for(var i:int = 0; i < aryObjects.length; i++)
{
tweens* = new Tween( aryObjects*, blah blah blah);
tweens*.addEventListener(TweenEvent.MOTION_FINISH, tweenFinished);
}
}
function tweenFinished(e:TweenEvent):void
{
//is it possible to access current mc the tween is moving through TweenEvent here?
}
If not possible, how would I pass the current object in the loop to the function?
I had one idea of creating a function within the addEventListener line and passing both the event and current object, but it is not working for some reason.
tweens*.addEventListener(TweenEvent.MOTION_FINISH, function done(e:TweenEvent){tweenFinished(e,aryObjects*);});
Any help or ideas are much appreciated.
Edit: I know that Tweener or TweenLite would work well but I want to do this without using them.