Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pausing a clip, including the nested clips?

Status
Not open for further replies.

EricAndresen0

Programmer
Jul 30, 2003
15
0
0
US
I have learned everything I know about Flash by experimenting, so I apologize if my practices are not conventional. I am trying to make a button that will pause my entire movie, but when I make a movie, I usually have so many movie clips nested within one another in such a tangled mess that it is extremely difficult to pick out all the moving parts and synchronize a pause feature. Is there any way that I can pause a clip and include the nested clips? Is there some way to load an .swf file and then create my own controls for it? I am very confused ;-), please help.
 
put this in frame 1

function stopAll(j){
var i=0;
for (i in j){
if (typeof(j)== "movieclip"){
stopAll(j);
j.stop();
}
}
}

function playAll(j){
var i=0;
for (i in j){
if (typeof(j)== "movieclip"){
stopAll(j);
j.play();
}
}
}



thats your stop and play functions defined

to use them on a button with an instance name add

paused = false;
pause_btn.onRelease = function(){
if(!paused){
stopAll(_root) or stopAll(clipinstancename) etc
paused = true;
}else{
playAll(_root) etc
paused = false;
}
}

let me know if this works, it looks like it will, but its untested.


_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
Still can't get that code thing going can you?

Process TGML!

Regards,

cubalibre2.gif

Bacon, eggs and sunshine are still good for me!
 
Doesn't concern you but the instructor!

Regards,

cubalibre2.gif

Bacon, eggs and sunshine are still good for me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top