I’ve got a couple instances of the same movie clip on the stage. Via actionscript, I want to apply a tween to both instances. Then, when you click on the instance I want its tween to stop, but not affect the other instance. Does that make sense?
So here’s my code so far:
import mx.transitions.Tween;
import mx.transitions.easing.*;
function startHeartbeat(obj) {
var myTween1:Tween = new Tween(obj, "_xscale", Regular.easeInOut, 100, 150, 1, true);
var myTween2:Tween = new Tween(obj, "_yscale", Regular.easeInOut, 100, 150, 1, true);
// after the animation is done, keep doing it
myTween1.onMotionFinished = function() {
myTween1.yoyo();
myTween2.yoyo();
};
}
function stopHeartbeat(obj) {
// set the movie clip back to its original scale
obj._xscale = 100;
obj._yscale = 100;
// now what???
}
startHeartbeat(ball_mc);
startHeartbeat(ball_mc2);
ball_mc.onRelease = function () {
stopHeartbeat(ball_mc);
};
ball_mc2.onRelease = function () {
stopHeartbeat(ball_mc2);
};
Any help here is greatly appreciated!