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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pause a movie without adding frames? 1

Status
Not open for further replies.

funkymonk

Technical User
Dec 18, 2000
588
GB
I am pretty sure this has been asked before but I can't find the thread or faq.

I'm creating a simple screensaver with Flash and want the movie to pause for a certain amount of time [say 20 seconds] after the initial animation before it continues playing throught to the end and then starts again.

If you know how to do it could you give me the code please as I've been away from flash for a while now and suck at it!

Cheers all

funkymonk B-)

rod@sameplanet.co.uk
[un-finished - still]

********************
 
Put this in a blank movie clip :

Code:
onClipEvent (enterFrame) {
	var pause;
	var time;
	var what;
}
onClipEvent (enterFrame) {
	if (pause == true) {
		if (what == "root") {
			what = _root;
		} else {
			what = [what];
		}
		if (Number(time)>0) {
			what.stop();
			time = time-0.05;
		} else {
			what.play();
		}
	}
}

And this on the frame you want to stop :

Code:
control.pause = true;
control.time = 5;
control.what = "root";
Regards

Big Bad Dave

davidbyng@hotmail.com
 
Hi Dave,

I just payed your movie and it doesn't play after the pause. I have no idea why.... you..? funkymonk B-)

rod@sameplanet.co.uk
[un-finished - still]

********************
 
I updated it, seems to work now. Regards

Big Bad Dave

davidbyng@hotmail.com
 
another option for you which allows you to put the scripting on any movie-clip-timeline within your entire movie.


All you have to do is copy-n-paste these actions into the frame you want to pause and change the length of the pause to suit (1500 milliseconds in this example), the rest of the code works for itself:
Code:
/:currentclip+=2;
/:pcount++;
/:myarray[/:pcount] = "1500";
/:pcount++;
/:myarray[/:pcount] = "_level0"+_target;
_root.attachMovie("pauser", "p"+/:pcount, /:pcount);
stop ();

Just make sure that you're library contains my mc's 'pauser' and 'pauser2'. Right-click the mc 'pauser' in the Library, select Linkage, select Export symbol, and give it the name "pauser".

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Still on Flash 4 syntax Dave?

Regards,
wink4.gif
ldnewbie
 
ouch, did I leave an eval in there?....where did that level0 come from? Slap me with an iron bar, dang! ;-)

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Nope! Don't have anything agains _level0... But with /: variables settings!
Seems you haven't lost your bad habbit of long nights!
Or did you just get up... And the wife is making tea?

Regards,
wink4.gif
ldnewbie
 
i see. The reason I use them is it's easier/quicker by far when you're typing everything out in expert mode rather than typing _root every time, simple as that. But there's no excuse for the level.

I had lost the bad habits of long nights, but I'm back in Edinburgh now after a very good break and can't decide whther or not to have another week off. Spent 3 weeks with only browser software on the available pc's, agony. Siobhan will no doubt get the full-breakfast in an hour and a half.

dave
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Thanx to you both, Big Bads was the one I ended up using although it didn't go easy. working fine now though.

Again, thanx funkymonk B-)

rod@sameplanet.co.uk
[un-finished - still]

********************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top