Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash - ActionScript

Cancelling a wait function

 
Jump to:  
 
jahonjabali
PostPosted: Wed Aug 20, 2008 4:13 pm    Post subject: Cancelling a wait function
       
I have this wait function applied to a frame:

function wait() {
stop();
var myInterval = setInterval(function () {
play();
clearInterval(myInterval);
}, 26*1000);
}
wait();

and I would like to cancel this wait function, when a button is clicked. This
is a skip button that takes you to a frame label, but I need to somehow cancel
that wait function or it still takes affect in the movie. Could someone help
with the code that needs to be added?

Thanks.
 

 
Rothrock
PostPosted: Wed Aug 20, 2008 11:06 pm    Post subject: Re: Cancelling a wait function
       
clearInterval(myInterval);

That is what is needed to cancel the interval. However your variable,
myInterval, is internal to the wait function and I'm not sure if it will be
available to the scope of whatever button you use to cancel it. So be sure to
check the scope.
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

pokerstars odżywki Odzyskiwanie danych Angielski docieplenie domu