# Urgent! Timer in flash?

**URL:** <https://forum.kirupa.com/t/urgent-timer-in-flash/26977>\
**Category:** Uncategorized\
**Created:** [July 28, 2003, 10:52pm UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977 "2003-07-28T22:52:40Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fargate](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@Fargate](https://forum.kirupa.com/u/Fargate)\
**Post date:** [July 28, 2003, 10:52pm UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/1 "2003-07-28T22:52:40Z")

</div>

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…🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 28, 2003, 10:55pm UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/2 "2003-07-28T22:55:52Z")

</div>

did you… search first?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 1:13am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/3 "2003-07-29T01:13:09Z")

</div>

yes!!! I can’t find anything for what I described…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2003, 1:22am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/4 "2003-07-29T01:22:50Z")

</div>

[http://www.actionscript.org/actionscripts\_library/main/search.cgi?query=Countdown+Timer](http://www.actionscript.org/actionscripts_library/main/search.cgi?query=Countdown+Timer)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 12:17am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/5 "2003-07-30T00:17:29Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 1:03am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/6 "2003-07-30T01:03:05Z")

</div>

Here

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 1:46am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/7 "2003-07-30T01:46:29Z")

</div>

Claudio…you are my god…Thank you so much 🙂 🙂 🙂 🙂 I’m pretty sure that should do the trick 🙂 🙂 🙂 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 1:49am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/8 "2003-07-30T01:49:17Z")

</div>

You’re welcome =)  
If you want it to display 00:00 before movong to next frame, replace

```auto
remaining<=0

```

for

```auto
remaining<0

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 1:53am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/9 "2003-07-30T01:53:04Z")

</div>

yeah thanks a lot now it shows zero!!! :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 1:57am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/10 "2003-07-30T01:57:02Z")

</div>

welcome :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 30, 2003, 2:19am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/11 "2003-07-30T02:19:04Z")

</div>

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!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 31, 2003, 12:22am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/12 "2003-07-31T00:22:13Z")

</div>

please anyone?!?!?!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 31, 2003, 6:03am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/13 "2003-07-31T06:03:24Z")

</div>

I looked at your .fla

you have 2 dynamic text boxes, with no instance names.

secs\_remaining  
mins\_remaining

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 1, 2003, 1:38am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/14 "2003-08-01T01:38:59Z")

</div>

meaning what?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 1, 2003, 1:48am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/15 "2003-08-01T01:48:39Z")

</div>

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:

```auto

_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]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 1, 2003, 1:57am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/16 "2003-08-01T01:57:49Z")

</div>

Man I am so confused…I don’t see where I would put that in my script o\_O?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 1, 2003, 5:04am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/17 "2003-08-01T05:04:44Z")

</div>

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. :{

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 1, 2003, 7:58am UTC](https://forum.kirupa.com/t/urgent-timer-in-flash/26977/18 "2003-08-01T07:58:38Z")

</div>

Theres no need to give the text fields instance names, since im using the variable associated with them.
