Counting Down
Author |
Message |
jrblacquiere
|
Posted: Sat Apr 26, 2008 7:01 pm Post subject: Counting Down |
|
|
I'm trying to figure out how to countdown from 60-0 in flash, and once the time reaches 0, I need it to go to the next frame. Any ideas? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
syntax_error
|
Posted: Sat Apr 26, 2008 9:37 pm Post subject: RE:Counting Down |
|
|
Can any mod move this to the help section?
As it is not a tut.
And just to answer your question just have a frame that goes right after your 0 frame, isn't that the simplest thing to do? |
|
|
|
|
|
jrblacquiere
|
Posted: Sat Apr 26, 2008 9:38 pm Post subject: Re: Counting Down |
|
|
that wasn't very helpful! |
|
|
|
|
|
syntax_error
|
Posted: Sat Apr 26, 2008 10:41 pm Post subject: RE:Counting Down |
|
|
well if you wish for me to explain I will:
you have some set of frames counting down from 60 to 0 right?
As to make the countdown, jsut write one number on every 3ish frames so that you can still see them, and start at 60 then the following numbers on the next 3rd frame and so forth?
Subsequently, in the order of the frames place the next frame of what ever anmieation that you have |
|
|
|
|
|
r691175002
|
Posted: Sun Apr 27, 2008 1:17 pm Post subject: Re: Counting Down |
|
|
Well I will assume you dont want to create out 60*framerate frames of text to do this, so here is how it can be done with actionscript.
Start by creating a single frame with a dynamic text box named counter or something. On that frame (I'll call it frame one), put code along the lines of:
code: | var count:Number = 60; // Unsure which version of actionscript you are using |
Now create a second keyframe somewhere down the timeline (If your framerate is 30fps, put it on the 31st frame). On this frame put code like:
code: | count = count - 1; // Decreases count by 1
counter.text = count; // Sets the text in the dynamic text box
if (count >= 0)
gotoAndPlay(2); // If count is still greater than zero, go back to frame 2
// Dont go back to frame one because then counter will be reset to 60
|
Be aware that there are much better ways to do this, however this one is pretty simple.
I would also suggest taking flash questions to http://board.flashkit.com/board/ in the future. |
|
|
|
|
|
|
|