pausing flash

Out of context: Reply #4

  • Started
  • Last post
  • 5 Responses
  • smielke0

    Depending upon how you've already got your file site up it can either be quite easy or very tedious and challenging.

    First of all use the help section in flash to look up setting up a Listener for the space bar. It's in the listener you'll be dropping all of your code to control the playing of the timeline and any movieclips.

    If you have a ton of Movieclips on the stage with animations going then a previous poster is correct in stating that you'll have to target each movie clip with a stop() and a play(). It's gonna be a pain in the butt. If you can limit your movieclip usage then you can stop/play the main timeline with just a simple stop() and play().

    Finally to stop sound..if you've got a lot of it going on you can look up Sound Object in the Help section if you want. Set up a sound object in the Main timeline. Setting it to 0 will mute ALL sounds and bringing it back up; to 100 will turn on all sounds no matter how many nested sounds you have in movieclips. Another option if you have only one main soundtrack in the root would be to just set the audio to stream. That means that if the main timeline ever stops the music will stop too. This wont work for tons of nested sounds though.

    Sorry for not posting any specific code examples but im heading out the door.

    Good luck

View thread