pausing flash

  • Started
  • Last post
  • 5 Responses
  • shutdown

    is there a way of pausing flash, including sounds by say, pressing the space bar...and then pressing it again makes the movie carry on.

    i can do "timed pauses" but don't know where to begin for stopping the whole thing.

    anybody help me please? that's a pretty please too!

  • chrisRG0

    i´m not 100% sure, but i guess you can´t stop a movie clip without addressing it...

    for ex: a mc with nested mcs..
    _root.main_mc.stop()
    _root.main_mc.nested1_mc.stop();
    _root.main_mc.nested1_mc.sub_mc...
    and etc...

    anyway, i heard smt about call the printer job stop all clips running, i´m just not sure if there´s a way to hide the printer box.

    and another solution, you could build a 'for in' loop to track all objects in your flash and stop'em, i´ve never try that, but i´ve heard about it too.

  • tkmeister0

    yes, you can.

    you just need to set it up correctly.

  • kinetic0

    i think you have to set up your sound as stream as well to get it to start and stop

  • 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

  • T-Dawg0

    as previously mentioned, if you want to pause your movie, you have to create a stop(); for each movieclip contained in your animation.

    If you want to pause sound, it has to be either a sound placed onto your timeline as a stream sound (not event sound). and when you stop(); the movie clip it's contained in , the sound stops too. I find this method doesn't always stop or restart your sound at the EXACT same spot.

    or, if you're loading your sounds via actionscript:
    yourSound = new sound();
    yourSound.attachSound("testMP3...

    you'll have to track the sound's position when you pause, you can find tutorails on this but I don't have one off hand.

    This method gives much more control over your sounds, such as mute functionality and such.