Copy link to clipboard
Copied
At the moment I have an animation, the animation is a bike with moving spokes that moves around, but when I press my pasue button the Bike stops but the spokes keep moving. The spokes and inside the bike as a Movie Clip. I am using Actionscript 3.
My code for the pasue button is:
play();
pauseButton_btn.addEventListener(MouseEvent.CLICK,stopNow);
function stopNow(e:MouseEvent){
stop();
}
you need to apply a stop() to your wheel movieclip that's inside your bike movieclip. assign it an instance name (eg, wheel_mc) and use:
play();
pauseButton_btn.addEventListener(MouseEvent.CLICK,stopNow);
function stopNow(e:MouseEvent){
stop();
wheel_mc.stop(); // if you have two wheels, assign each a different instance name and assign a stop() to each.
}
Copy link to clipboard
Copied
you need to apply a stop() to your wheel movieclip that's inside your bike movieclip. assign it an instance name (eg, wheel_mc) and use:
play();
pauseButton_btn.addEventListener(MouseEvent.CLICK,stopNow);
function stopNow(e:MouseEvent){
stop();
wheel_mc.stop(); // if you have two wheels, assign each a different instance name and assign a stop() to each.
}
Copy link to clipboard
Copied
is "wheel_mc" the instance name?
Copy link to clipboard
Copied
yes.
(but, you need to assign instance names.)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now