Skip to main content
January 15, 2013
Answered

Symbol wont stop when I press my Pause Button

  • January 15, 2013
  • 1 reply
  • 599 views

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();

}

This topic has been closed for replies.
Correct answer kglad

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.

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
January 15, 2013

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.

}

January 15, 2013

is "wheel_mc" the instance name?

kglad
Community Expert
Community Expert
January 15, 2013

yes.

(but, you need to assign instance names.)