Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-23-2009, 01:29 PM   #1
nagyordog
Registered User
 
Join Date: Oct 2009
Posts: 2
Default waitScript for pausing timeline with a function

I have been using the following script to pause the time line in 2.0 and it has been extremely effective. Is there any 3.0 version of the script? This is a global script, I basically just have to included a function "wait(<seconds to pause goes here>); and it pauses.

MovieClip.prototype.wait = function(ff_myPause) {
//waitScript 1.2, updated aug 29th 2005 by flowsen
this.stop();
if (ff_wait_cnt == undefined) {
_global.ff_wait_cnt = 0;
}
ff_wait_cnt++;
_global["ff_myFrame"+ff_wait_cnt] = this._currentframe;
_global["ff_myPath"+ff_wait_cnt] = this;
function ff_goFurther(ff_index) {
if (_global["ff_myPath"+ff_index]._currentframe == _global["ff_myFrame"+ff_index]) {
_global["ff_myPath"+ff_index].play();
}
clearInterval(_global["ff_waitInt"+ff_index]);
}
_global["ff_waitInt"+ff_wait_cnt] = setInterval(ff_goFurther, ff_myPause*1000, ff_wait_cnt);
};

//Very effective code to use to pause the frame for a second or seconds, simply
//put a function on the timeline written like this wait(1); This means that the timeline
//will pause for 1 second, before resuming play.

Last edited by nagyordog; 10-23-2009 at 01:33 PM. Reason: Including additional comments.
nagyordog is offline   Reply With Quote
Old 10-23-2009, 01:35 PM   #2
nagyordog
Registered User
 
Join Date: Oct 2009
Posts: 2
Default

Is there any code that works like the following I have been using with AS 2.0, where I place the following code on a key frame and I can use a function anywhere on the time line to pause it?

MovieClip.prototype.wait = function(ff_myPause) {
this.stop();
if (ff_wait_cnt == undefined) {
_global.ff_wait_cnt = 0;
}
ff_wait_cnt++;
_global["ff_myFrame"+ff_wait_cnt] = this._currentframe;
_global["ff_myPath"+ff_wait_cnt] = this;
function ff_goFurther(ff_index) {
if (_global["ff_myPath"+ff_index]._currentframe == _global["ff_myFrame"+ff_index]) {
_global["ff_myPath"+ff_index].play();
}
clearInterval(_global["ff_waitInt"+ff_index]);
}
_global["ff_waitInt"+ff_wait_cnt] = setInterval(ff_goFurther, ff_myPause*1000, ff_wait_cnt);
};

//Very effective code to use to pause the frame for a second or seconds, simply
//put a function on the timeline written like this wait(1); This means that the timeline
//will pause for 1 second, before resuming play.

Last edited by nagyordog; 10-23-2009 at 01:36 PM. Reason: restructured
nagyordog is offline   Reply With Quote
Old 10-24-2009, 07:55 PM   #3
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,886
Send a message via Skype™ to henke37
Default

Run a Timer and wait for it to fire.
henke37 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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:37 PM.

///
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.