Clock Countdown
- svsaproductions
-
svsaproductions
- Member since: Nov. 15, 2008
- Offline.
-
- Forum Stats
- Member
- Level 07
- Programmer
Hello,
How can I create clock (just a dynamic txt field) with minutes and seconds that counts down, when it gets to a minute it turns red, but if it hits Zero, it goes to a frame, let's say frame "game over".
Please help,
-Jim
me.addEventListener(Event.Whenever_
You_Move, function (e:Event):void { gotoAndSay("WTF?") } );
On. actionComplete(run);
- liam
-
liam
- Member since: Dec. 11, 2004
- Offline.
-
- Send Private Message
- Browse All Posts (14,243)
- Block
-
- Forum Stats
- Member
- Level 22
- Blank Slate
You'd be best making a function such as:
function timeConv(sec:int):String {
var mins:int = 0;
while(sec>=60){
mins++;
sec-=60;
}
return String(mins+":"+sec);
}
(probably not perfect I just wrote as an example) and then just have an int variable named time with the maximum time and each second take away 1 from it, have something like:
mytextbox.text = timeConv(total_time); Sup, bitches :)
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
For changing the colour of the clock press F1 in Flash and look up textFormat.color. Hex for red is 0xFF0000
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
Countdown clock (fla)
AS: Clock by Glaiel_Gamer
- liam
-
liam
- Member since: Dec. 11, 2004
- Offline.
-
- Send Private Message
- Browse All Posts (14,243)
- Block
-
- Forum Stats
- Member
- Level 22
- Blank Slate
At 2/10/09 09:35 AM, Denvish wrote: Countdown clock (fla)
AS: Clock by Glaiel_Gamer
Brown nose!
Fantastic coding style by the way, I guess doing it for a job it just comes natural.. commenting so meticulously.. unless you only did that for the guys benefit ^_^
Sup, bitches :)
- svsaproductions
-
svsaproductions
- Member since: Nov. 15, 2008
- Offline.
-
- Forum Stats
- Member
- Level 07
- Programmer
Thanks guys, I really appreciate it... Thanks,
-Jim
me.addEventListener(Event.Whenever_
You_Move, function (e:Event):void { gotoAndSay("WTF?") } );
On. actionComplete(run);
- Denvish
-
Denvish
- Member since: Apr. 25, 2003
- Offline.
-
- Send Private Message
- Browse All Posts (15,977)
- Block
-
- Forum Stats
- Member
- Level 46
- Blank Slate
At 2/10/09 09:45 AM, liaaaam wrote: Fantastic coding style by the way, I guess doing it for a job it just comes natural.. commenting so meticulously.. unless you only did that for the guys benefit ^_^
Nah, they're both functions I re-use for quite a few of the games I make, I learnt the hard way that going back into old projects is a LOT harder without comments
- svsaproductions
-
svsaproductions
- Member since: Nov. 15, 2008
- Offline.
-
- Forum Stats
- Member
- Level 07
- Programmer
Anyways, thanks for sharing the code and movieclip, it's just what I needed and worked excellent with a change of font. :)
me.addEventListener(Event.Whenever_
You_Move, function (e:Event):void { gotoAndSay("WTF?") } );
On. actionComplete(run);
- svsaproductions
-
svsaproductions
- Member since: Nov. 15, 2008
- Offline.
-
- Forum Stats
- Member
- Level 07
- Programmer
Actually, this is as2... when transfered to my as3 movie... KABOOM.... PLEASE POST AN AS3 CLOCK!!!! PLEASE!!!!! Sorry I didn't specify this earlier.!
me.addEventListener(Event.Whenever_
You_Move, function (e:Event):void { gotoAndSay("WTF?") } );
On. actionComplete(run);
- svsaproductions
-
svsaproductions
- Member since: Nov. 15, 2008
- Offline.
-
- Forum Stats
- Member
- Level 07
- Programmer
me.addEventListener(Event.Whenever_
You_Move, function (e:Event):void { gotoAndSay("WTF?") } );
On. actionComplete(run);
- svsaproductions
-
svsaproductions
- Member since: Nov. 15, 2008
- Offline.
-
- Forum Stats
- Member
- Level 07
- Programmer
me.addEventListener(Event.Whenever_
You_Move, function (e:Event):void { gotoAndSay("WTF?") } );
On. actionComplete(run);
- Luis
-
Luis
- Member since: Apr. 23, 2000
- Offline.
-
- Send Private Message
- Browse All Posts (17,261)
- Block
-
- Forum Stats
- Member
- Level 02
- Melancholy
At 2/12/09 06:54 AM, svsaproductions wrote: but noone is answering me... Please answer
most people are still sleeping at 6 am... chill out.
None
- svsaproductions
-
svsaproductions
- Member since: Nov. 15, 2008
- Offline.
-
- Forum Stats
- Member
- Level 07
- Programmer
me.addEventListener(Event.Whenever_
You_Move, function (e:Event):void { gotoAndSay("WTF?") } );
On. actionComplete(run);
- knugen
-
knugen
- Member since: Feb. 7, 2005
- Offline.
-
- Forum Stats
- Member
- Level 42
- Programmer


