I really need help on this and I need to know it soon so if anyone could help that would be really great. How would I make a timer in flash say that counts down from like 1:30…perhaps the timer is displayed in a dynamic textbox? And then when it reaches zero I could somehow program it so that it goes to another frame?Thanks in advance…
did you… search first?
yes!!! I can’t find anything for what I described…
Thanks a lot claudio…but I’m not sure what to do with the script really
[AS]onClipEvent (load) {
mins = 10;
start = getTimer()/1000;
countdown = true;
}
onClipEvent (enterFrame) {
if (countdown) {
remaining = Math.round((mins*60)-((getTimer()/1000)-start));
secs_remaining = remaining%60;
mins_remaining = Math.floor(remaining/60);
if (remaining <= 0) {
mins_remaining = 0;
secs_remaining = 0;
countdown = false;
// some event
}
}
}[/AS]
I tried putting it in a dynamic txt box mc…is that what I’m supposed to do…I’m really confused here…help!
Here
Claudio…you are my god…Thank you so much
I’m pretty sure that should do the trick
You’re welcome =)
If you want it to display 00:00 before movong to next frame, replace
remaining<=0
for
remaining<0
yeah thanks a lot now it shows zero!!! :beam:
welcome :beam:
Aww man…I tried to incorporate it into my game and isn’t working!!! Help I’m so close!!! Please someone look at the fla. and tell me what on earth is wrong!!!
please anyone?!?!?!
I looked at your .fla
you have 2 dynamic text boxes, with no instance names.
secs_remaining
mins_remaining
meaning what?
Hey!! This game looks awfly familiar!!! You know that bug that it still has, I kinda gave up on it, but I think you have to put all the hitTest things in an array - that’s what was done on that ‘Galaxia’ game that that other guy posted for us. I’m no good with arrays.
Anyhow, current problem…Your dynamic text boxes need to have instance names when you point at them from your scripts. Also, those text boxes reside in a movieClip, so you have to name that movieClip and then target your text boxes like:
_root.movieClip.textbox=whatever;
Let me know when you get that puppy working!!
[edit]love the new quick edit thing!! -
If anything, take the textboxes out of the movieClip and plop them on the _root stage…[edit]
Man I am so confused…I don’t see where I would put that in my script o_O?
In that case, try option two that I left. Take the dynamic text boxes out of the movieClip and plop them on the stage by themselves, that way, you won’t have to worry about targeting them.
Another thing, you may want to add more layers, it is getting a bit confusing. I think it still has the same amount of frames when I made it. :{
Theres no need to give the text fields instance names, since im using the variable associated with them.