Hi,
make three movie clips on the stage .
name them as mainMc, mc_1, mc_2
and put this code on first frame of stage.
var stopAnim:Boolean = false;
mainMc.onRollOver = function() {
stopAnim = true;
};
mainMc.onRollOut = function() {
stopAnim = false;
};
function fun() {
if (!stopAnim) {
speed = 1;
mainMc._x -= speed;
mc_1._x -= speed*2;
mc_2._x -= speed+2;
if (mainMc._x<(0-mainMc._width)) {
mainMc._x = 800;
}
if (mc_1._x<(0-mc_1._width)) {
mc_1._x = 800;
}
if (mc_2._x<(0-mc_2._width)) {
mc_2._x = 800;
}
}
updateAfterEvent();
}
var Id:Number = setInterval(fun, 10);
always use to put the code on frames, that is easy to call or handle other instances.
|