Hi there,
i got an little problem with the "onComplete" thing.
I want to try the following:
TweenMax.fromTo(fire[iD2], duration, {x:player[iD].x, y:player[iD].y}, {x:destinationX, y:destinationY, onComplete:test(fire[iD2]), ease:Linear.easeNone} );
function test(e)
{trace("remove");}
to move the fire[iD2] mc to the location of the player[iD] mc. This is working like wanted but the onComplete function is called in the moment the tween starts, not in the moment the tween ends.
If i use
TweenMax.fromTo(fire[iD2], duration, {x:player[iD].x, y:player[iD].y}, {x:destinationX, y:destinationY, onComplete:test, ease:Linear.easeNone} );
function test()
{trace("remove");}
without the "(fire[iD2])" it works correct and starts the function at the end of the tween.
Is this normal and is there an easy way to work around this?
What i want to achive in the "test" function is that the "fire[iD2]" mc gets removed. I allready read about using "onComplete:stage.removeChild(fire[iD2])", which also does not work for me.