A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How to pause my flash movie

  1. #1
    Junior Member
    Join Date
    Jun 2009
    Posts
    1

    How to pause my flash movie

    Hi

    I have created a presentation with software trendy flash intro creater.

    The movie it creates runs in flash player..but there i no option to pause the movie.

    I am looking for someway to able myself to pause the movie in middle as it is very important for me to give presentation to my class.

    I have converted the swf files to fla so that you can check it and let it to pause.

    kindly help me as this is very important for me!!! plz!!!!
    here is my movie with all files
    presentation

  2. #2
    Junior Member
    Join Date
    Jun 2009
    Posts
    2
    Hi yasir123

    I sourced some code awhile back when I needed to do something similar.

    First make sure all your content is in movie clips 1 or more is fine. If you have lots on the stage then you need to name them mc1, mc2, etc. Then setup an Array in your actions frame.

    Code:
    myMovieClips = new Array("mc1", "mc2", "mc3", "mc4", "mc5", "mc6", "mc7");
    Once you have the same corresponding clip names in the array as on the stage add a function with a for loop for the stop and play elements.

    Code:
    // play
    function myMovieClipsStart() {
    	trace("play");
    	for (var i = 0; i<=myMovieClips.length-1; i++) {
    		this[myMovieClips[i]].play();
    	}
    
    }
    
    // pause/stop
    function myMovieClipsStop() {
    	trace("pause");
    	for (var i = 0; i<=myMovieClips.length-1; i++) {
    		this[myMovieClips[i]].stop();
    	}
    
    }

    Now all you need is the code for the 2 buttons;

    Code:
    this.pause_btn.onRelease = function() {
    	myMovieClipsStop();
    };
    
    this.play_btn.onRelease = function() {
    	myMovieClipsStart();
    };

    From what I can gather the above as tells each movieclip to stop it's timeline when pause is pressed and then continue once play is pressed. Good luck.

    Hope that helps -
    Jimmy Bob

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