Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-18-2012, 03:44 PM   #1
robertochampa
Registered User
 
Join Date: Jun 2012
Posts: 2
Default how to stop Counter and Timer

hello,

i have a simple Timer - wich counts down from 10 to zero
than a interval counts too for 10 seconds and than goto another
frame.


but when i go faster to another frame the counter doesnt stop

so: How to stop the simple Timer:

that doest work:

clearInterval(intervalID);
clearInterval(gocountdown);
clearInterval(counter);
delete this.onEnterFrame;
delete counter.onEnterFrame;
clearInterval(countdown);
clearInterval(i);
clearInterval(n);



here is timer function

count = 10;
countdown = function(){
count--;
if (count ==0){
clearInterval(doCountdown);
}
}

doCountdown = setInterval(countdown, 1000);

and this is the interval function:

stop()

var myinterval:Number;
function goto() {
gotoAndPlay(1);
for(i=3;i<=5;i++){
delete _root["var"+i];
}
clearInterval(myinterval);
}
myinterval = setInterval(goto, 10000);


see fla below

thanks
Attached Files
File Type: zip timer_kirupa.zip (12.7 KB, 10 views)
robertochampa is offline   Reply With Quote
Old 06-18-2012, 06:59 PM   #2
Prid
Prid - Outing
 
Prid's Avatar
 
Join Date: Oct 2009
Location: Halden, Norway
Posts: 1,157
Send a message via MSN to Prid Send a message via Skype™ to Prid
Default

ActionScript Code:
clearInterval(doCountdown); clearInterval(myinterval);

this?
__________________
17 Years old boy, who loves the Computer Technology
Prid is offline   Reply With Quote
Old 06-19-2012, 02:21 PM   #3
robertochampa
Registered User
 
Join Date: Jun 2012
Posts: 2
Default

yeah rigth!

thanks....
robertochampa 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 08:24 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, 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.