Tween animation

hi,

using AS tween animation, I need to know that a certain mc reach the end of the animation, how can i do this?

I could make a enterFrame check for the value of the animation…for example, if mc._x = 300 this would do…but if I’ve 50 mc that could be cpu intensive… any clues?!

.am

hey,
sorry for the delay but i was out this weekend, thanks for the reply, by the way
creatify, o k it works that way, but i’m was trying something shorter when calling the function, but know i don’t know how to concatenate this piece of code

function movon (_from) {
var areaA1:Tween = new Tween (main, “_x”, Strong.easeInOut, [“main.coord”+_from], -main.coordA2._x, 3, true);

when calling the function just want to say
movon(A1)
so the result would be
main.coordA1._x
how can i do this?
:slight_smile:

am

So you want to move the coord’s depending on which one you pass? Try [AS]function movon (vfrom:String) {
var areaA1:Tween = new Tween (main, “_x”, Strong.easeInOut, main[“coord”+vfrom]._x, -main.coordA2._x, 3, true);
}[/AS] So, [AS]movon(“A1”);[/AS] would move main MC from main.coordA1._x to -main.coordA2._x. You could, however, modulize it further and have more properties passed to the function like: [AS]MovieClip.prototype.tweenTo = function(vfrom:String, vto:String, dur:Number) {
var areaA1:Tween = new Tween (this, “_x”, Strong.easeInOut, main[“coord”+vfrom]._x, main[“coord”+vto]._x, dur, true);
}

main.tweenTo(“A1”,“A2”,3);[/AS]