Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Location
    uk leeds
    Posts
    4

    Default Countdown timer.. in flash 8

    hello all,

    just wondering if could lend me a hand..

    I really need a countdown timer for "startgame" secene on my project

    how easy is it to do this? id like it to countdown from 60seconds as soon as you enter that page..

    is this possible?

    Matt
    Matt java help needed...

  2. # ADS
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many
     
  3. #2
    Join Date
    May 2004
    Location
    U.S.A.
    Posts
    2,890

    Default

    Hi,

    Code:
    /*
      Count Down Timer 
            T. Norman
       http://ntdesigns.net
    */
    function countDownTimer(minute, tX, tY) {
    	_root.createEmptyMovieClip("countDown", 10);
    	cCenterX = tX;
    	cCenterY = tY;
    	_root.countDown.counter._x = cCenterX;
    	_root.countDown.counter._x = cCenterY;
    	_root.countDown.createTextField("myTextField", 1, cCenterX, cCenterY, 30, 20);
    	_root.countDown.myTextField.background = true;
    	_root.countDown.myTextField.autoSize = "center";
    	_root.countDown.myTextField.border = true;
    	_root.countDown.myTextField.backgroundColor = 0x00FFCC;
    	minute = minute;
    	seconds = 59;
    	myCountDown = function () {
    		seconds--;
    	};
    	countInterval = setInterval(myCountDown, 1000);
    	this.onEnterFrame = function() {
    		if &#40;seconds<10&#41; &#123;
    			_root.countDown.myTextField.text = minute-1+"&#58;"+"0"+seconds;
    		&#125; else &#123;
    			_root.countDown.myTextField.text = minute-1+"&#58;"+seconds;
    		&#125;
    		if &#40;seconds === 0&#41; &#123;
    			clearInterval&#40;countInterval&#41;;
    			seconds = "0";
    			minuteDelay = setInterval&#40;minuteChangeDelay, 1000&#41;;
    		&#125;
    		if &#40;_root.countDown.myTextField.text == "0&#58;00"&#41; &#123;
    			delete this.onEnterFrame;
    			_root.countDown.myTextField.text = "Time Up!";
    		&#125;
    	&#125;;
    	minuteChangeDelay = function &#40;&#41; &#123;
    		minute--;
    		seconds = 59;
    		countInterval = setInterval&#40;myCountDown, 1000&#41;;
    		clearInterval&#40;minuteDelay&#41;;
    	&#125;;
    &#125;
    //Usage..... functionName&#40;minutes,x position,y position&#41;
    countDownTimer&#40;1, 400, 200&#41;;
    A mind once stretched by a new idea never regains its original dimensions.
    - Oliver Wendell Holmes

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Scripting Countdown Timer
    By Lelock1 in forum Advanced Flash
    Replies: 2
    Last Post: 09-30-2006, 07:18 PM
  2. Countdown script
    By tomleadbetter in forum Flash Scripting
    Replies: 0
    Last Post: 07-28-2006, 12:57 PM
  3. countdown timer
    By ifty40 in forum Flash Scripting
    Replies: 3
    Last Post: 07-25-2005, 04:50 AM
  4. count up in timer?
    By bluereo in forum Flash Scripting
    Replies: 1
    Last Post: 06-17-2005, 07:34 PM
  5. Simple Countdown Timer, help.
    By FF7fan in forum Newbies
    Replies: 1
    Last Post: 04-14-2005, 01:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial