Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-26-2007, 05:11 PM   #1
tsteuwer
Registered User
 
Join Date: Jul 2007
Posts: 2
Default how to pause a MC from replaying over and over

I can't find anything on how to pause a MC from replaying over and over. I want to pause it for like 20 seconds and then make it loop.

Anyone know how? Thanks!
tsteuwer is offline   Reply With Quote
Old 07-26-2007, 06:02 PM   #2
Noct
Toys in the Attic...
 
Noct's Avatar
 
Join Date: Oct 2006
Location: NY
Posts: 3,022
Default

Welcome aboard,
You can use setInterval to time events:
ActionScript Code:
//Stop the clip this.myMc.stop(); //Declare the interval with a 20 second timer var myInt = setInterval(pauseClip, 20000); //Declare function interval calls function pauseClip() {     //Play the clip     this.myMc.play();     //delete the interval so it only happens once     clearInterval(myInt); }

Assuming there are no stop commands in your clips timeline, it will loop automatically after the interval has started it.
__________________
http://rwithers.com
Noct is offline   Reply With Quote
Old 07-26-2007, 08:43 PM   #3
tsteuwer
Registered User
 
Join Date: Jul 2007
Posts: 2
Default

Thanks for your help! I know I'm a newbie and everyone hates newbies lol

This makes me even more confused. So where exactly do I put this action script? In the last frame inside the movie clip?

Also, I assume the "this.myMC.stop();" is supposed to have the name of my movie clip for the "myMC" part right?

Lastly, I do want the movie clip to keep playing and looping, I just want a 20 second pause at the end each time it plays so I dont have to use like 5,000 blank frames. How would do that? Take out the "clearInterval(myInt)?"

//edit// Oh, and I do have a stop(); in the main scene, on the last frame, so all the mc's don't keep looping. How do I get around that?
tsteuwer is offline   Reply With Quote
Old 07-26-2007, 09:31 PM   #4
Noct
Toys in the Attic...
 
Noct's Avatar
 
Join Date: Oct 2006
Location: NY
Posts: 3,022
Default

NP, and most people around here don't hate newbies as long as they are willing to learn.
The people who just come here to get someone to do their work for them (for free) on the other hand...

Anyways, that script as I wrote it would go on the the first frame of the main timeline holding the clip you want to control, and yes you would have to put in the name of your clip. myMC is just there as an example.

Thing is, I misunderstood what you wanted. If you want the clip to pause on its last frame, change the script to this, and place it directly on the last frame of the movieClip you want to pause:
ActionScript Code:
//Stop the clip this.stop(); //Declare the interval with a 20 second timer var myInt = setInterval(pauseClip, 20000); //Declare function interval calls function pauseClip() {     //Play the clip     this.play();     //delete the interval so it only happens once     clearInterval(myInt); }

As for your last question, you don't have to worry about it.
Every movieClip in Flash has its own independant timeline. Stopping the main timeline would not stop the animation in movieClips on it, they would need to be stopped seperately.
__________________
http://rwithers.com
Noct is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:29 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.