A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: Pause a Movie - PLEASE HELP !!

  1. #1
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21

    Pause a Movie - PLEASE HELP !!

    I have a flash presentation which has lots of movie clips, tweens and graphics (some movie clips within movie clips) - its a 5 minute presentation. I need to have a pause button on the main stage !!! Need help on how to get this one done !?!

    Please post a tutorial or a sample movie.

    Thanks a lot in advance.

  2. #2
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    Just have your pause button tell all the movieclips on the stage to stop()...

    Code:
    pauseBtn_mc.onPress = function(){
       this._parent.movieClipName.stop();
       this._parent.movieClip2Name.stop();
       this._parent.movieClip2Name.nestedClip.stop();
    }
    Hope that helps!
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  3. #3
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    My parent movie clip (scene 1) is like this - it has 190 frames but on one of the layer in the last frame it calls another movie clip which has 13000 frames !! now if i stop all movie clips on the parent scene, it still plays the 13000 frames movie clip !!

    should i call all the movie clips in the library to stop (i've got thousands of mc's

  4. #4
    Senior Member Speed85's Avatar
    Join Date
    Apr 2007
    Posts
    292
    Holy crap dude... Thats a lot of movie clips... Anyways, are they named in any form of pattern? Like mc1, mc2, mc3. Or are all of them descriptive?

  5. #5
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    Forgot to add - the presentation has music too. Can i pause the music and when i click play, does it start from where it stopped ?!?!

  6. #6
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    Here is a sample fla (flash 8). Please tell me how to do the pause in this file. i can use it for my presentation.

    http://www.mansfield-nursery.com/flash/pause_sample.zip

    Thanks a zillion !!

  7. #7
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    All mc's are named descriptive - like why_our_company, etc and some of them are just symbols like Symbol 116

  8. #8
    anyone else hear that? flashpipe1's Avatar
    Join Date
    Jan 2003
    Location
    Upstate NY
    Posts
    1,930
    Here's one way to do it...it'll be easiest if you name the instances (NOT the symbol name, the Instance...in the properties panel when you select it on the stage) something like mc1, mc2, mc3, then you can use a loop to hit them all...see the sample...

    And, you have to put the audio in a movieclip and set it to stream and then you can control the audio by controlling that movieclip. Otherwise, you have to use the Sound class.

    Hope that helps!!
    Last edited by flashpipe1; 09-10-2007 at 01:30 PM.
    Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.

  9. #9
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    Thanks a lot. Just one question - how do i stop a movie clip within a movie clip - should i go

    this.movieclipname1_mc.movieclip2_mc.stop();

  10. #10
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    Also im not able to stop certain animations and certain movie clips, even though i've given them an instance name and called it in the pause button !!

  11. #11
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    create functions on frame#1 of the main timeline and use when needed.
    this example uses a single button to toggle between stop / start -
    Code:
    _global.stopAll = function (j) {
    var i = 0;
    for (i in j) {
    if (typeof (j[i]) == "movieclip") j[i].stop();
    if (j != j[i]) _root.stop();
    }
    };
    
    _global.startAll = function (j) {
    var i = 0;
    for (i in j) {
    if (typeof (j[i]) == "movieclip") j[i].play();
    if (j != j[i]) _root.play();
    }
    };
    
    
    bToggle.onRelease = function(){
    toggled ? startAll(_level0) : stopAll(_level0);
    toggled = !toggled;
    };
    hth

  12. #12
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    a_modified_dog, can you please use this in a sample movie and send me the clip. I am a newbie when it comes to action script.

    Thanks and sorry for the trouble.

  13. #13
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    sample file attached

  14. #14
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    As in your example should i name all my movie clips as mc1, mc2, etc ?!

  15. #15
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    Pause button works great. But when i click on it again to play, it starts from the first frame and not from where it stopped.

  16. #16
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    Please check the attached file. The animation on the last frame does not stop (all others stop) !!

    Thanks a lot for the help
    Attached Files Attached Files

  17. #17
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    change the functions to these to start/stop the nested clip -
    Code:
    _global.stopAll = function (j) { 
    var i = 0; 
    for (i in j){ 
    if ((typeof (j[i]) == "movieclip") && (j != j[i])) { 
    stopAll(j[i]); 
    j[i].stop(); 
    } 
    } 
    }; 
    
    _global.startAll = function (j) {
    var i = 0; 
    for (i in j){ 
    if ((typeof (j[i]) == "movieclip") && (j != j[i])) { 
    startAll(j[i]); 
    j[i].play(); 
    } 
    } 
    };
    
    bToggle.onRelease = function(){
    toggled ? startAll(_level0) : stopAll(_level0);
    toggled = !toggled;
    };
    hth

  18. #18
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    Just one last thing and im all done - Thanks a million to you.

    The header in Symbol 11 stops when i press once, but when i press again to play, it starts again from first. Arrow seems to work great.

    Thanks again.
    Attached Files Attached Files

  19. #19
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    is this an improvement ?

  20. #20
    FLASH LOVER
    Join Date
    Apr 2007
    Location
    ST.LOUIS MO, USA
    Posts
    21
    Thanks for the file a_modified_dog

    But when the "contact us" finishes its tween and when its sitting static (idle), now when you press the toggle button, the arrow pauses, when you press the toggle button again, the arrow plays and along with it the "contact us" starts to tween again !! - do you get me?! The contact us should just tween once and never again - when you press the toggle button.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center