The first code is the function that moves and sizes a clip, and the second code is attached to the button. Why does this only work on one clip (always the last one one) and not both of them? I’ll eventually need this to work on many clips at the same time, but I just don’t understand why it’s not working. Can anyone tell me what needs to be done?
Thanks
// move movie clips
function moveMovieClips(theMovie) {
baseX = theMovie._x;
baseY = theMovie._y;
moveRate = 1;
distance = 10;
currentState = -1;
scaleRate = 2;
//
onEnterFrame = function () {
if (currentState == 1) {
theMovie._x += moveRate;
theMovie._xscale -= scaleRate;
theMovie._yscale -= scaleRate;
if (theMovie._x >= baseX + distance) {
currentState = 2;
theMovie._x = baseX + distance;
}
}
else if (currentState == 3) {
theMovie._x -= moveRate;
theMovie._xscale += scaleRate;
theMovie._yscale += scaleRate;
if (theMovie._x <= baseX ) {
currentState = -1;
theMovie._x = baseX;
theMovie._xscale = 100;
theMovie._yscale = 100;
}
}
};
}
//
on (rollOver) {
moveMovieClips(clip1_mc);
moveMovieClips(clip2_mc);
currentState = 1;
}
on (rollOut) {
moveMovieClipsBack(clip1_mc);
moveMovieClipsBack(clip2_mc);
currentState = 3;
}