A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: 10 minute countdown

  1. #1
    Junior Member
    Join Date
    Nov 2010
    Posts
    5

    10 minute countdown

    Hi all,

    Im trying to make a 10 minute countdown with white numbers and black background.

    just need minutes, seconds and milliseconds

    hope anyone can help in sending a fla file or in telling me the easiest way to do this. I dont need a start button or anything else, just the countdown and when time is over just the numbers as 00:00:000

    Thanks

  2. #2
    Flash/Flex Developer samac1068's Avatar
    Join Date
    Apr 2007
    Location
    Here, no there
    Posts
    1,813
    Using the Timer class should be able to handle everything. Here are a couple of tutorials that may help.

    http://www.republicofcode.com/tutori.../countdown.php
    http://www.kirupa.com/developer/mx/countdown.htm
    http://flashspeaksactionscript.com/f...ntdown-timers/
    Some people are like Slinkies, not really good for anything, but they bring a smile to your face when pushed down the stairs.

  3. #3
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Hi samuc1068

    The problem with thos tutorials is that all of them talk about countdowns to a specific date in the future an I only need it for 10 min.

    i will use this in my Bar telling everyone that the bar is closing in 10 min and countdown till 00

    Thanks in advance and sorry for answering to late

  4. #4
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Hi samac1068

    The problem with thos tutorials is that all of them talk about countdowns to a specific date in the future an I only need it for 10 min.

    i will use this in my Bar telling everyone that the bar is closing in 10 min and countdown till 00

    Thanks in advance and sorry for answering to late

  5. #5
    :
    Join Date
    Dec 2002
    Posts
    3,518
    What version of Flash and Actionscript are you using?
    Last edited by dawsonk; 02-06-2011 at 06:34 PM.

  6. #6
    Junior Member
    Join Date
    Dec 2010
    Posts
    1

  7. #7
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Quote Originally Posted by dawsonk View Post
    What version of Flash and Actionscript are you using?
    Im in MX 2004 version, but if I need to update to another flash and actionscript just let me know

    Thanks a lot

  8. #8
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    PHP Code:
    var tx:TextField = new TextField();
    addChild(tx);

    const 
    COUNTDOWN:uint 6000000;    //  600000 ms = 10 minutes

    addEventListener(Event.ENTER_FRAME, function(e:Event):void{
        var 
    d:Date = new Date(Math.max(COUNTDOWN getTimer(), 0));
        var 
    minutes:String String(d.minutes);
        var 
    seconds:String String(d.seconds);
        var 
    milliseconds:String String(int(d.milliseconds 100) / 100);

        while(
    minutes.length 2minutes '0' minutes;
        while(
    seconds.length 2seconds '0' seconds;
        while(
    milliseconds.length 3milliseconds '0' milliseconds;
        
    tx.text minutes ':' seconds '.' milliseconds;
    }); 
    Please use [php] or [code] tags, and mark your threads resolved 8)

  9. #9
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Quote Originally Posted by neznein9 View Post
    PHP Code:
    var tx:TextField = new TextField();
    addChild(tx);

    const 
    COUNTDOWN:uint 6000000;    //  600000 ms = 10 minutes

    addEventListener(Event.ENTER_FRAME, function(e:Event):void{
        var 
    d:Date = new Date(Math.max(COUNTDOWN getTimer(), 0));
        var 
    minutes:String String(d.minutes);
        var 
    seconds:String String(d.seconds);
        var 
    milliseconds:String String(int(d.milliseconds 100) / 100);

        while(
    minutes.length 2minutes '0' minutes;
        while(
    seconds.length 2seconds '0' seconds;
        while(
    milliseconds.length 3milliseconds '0' milliseconds;
        
    tx.text minutes ':' seconds '.' milliseconds;
    }); 
    Thanks a lot.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center