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