A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Another timer question

  1. #1
    Junior Member
    Join Date
    Nov 2000
    Posts
    9

    Another timer question

    I've downloaded a timer from mbenny Link.

    This code is on the first frame together with a dynamic instancename called "textbox".
    Code:
    onEnterFrame = function () {
    	time = getTimer();
    	miliseconds = time;
    	minutes = Math.floor(miliseconds/1000/60);
    	miliseconds -= minutes*1000*60;
    	seconds = Math.floor(miliseconds/1000);
    	miliseconds -= seconds*1000;
    	miliRound = Math.round(miliseconds/10);
    	min = (minutes<10 ? "0" : "")+minutes;
    	sec = (seconds<10 ? "0" : "")+seconds;
    	ms  = (miliRound<10 ? "0" : "")+miliRound;
    	textbox.text = min+":"+sec+":"+ms;
    		};
    I've put this source into a mc, and it works perfectly.
    But now i tried everything i know to reset the timer to 0, and begins counting again. It just won't work, or i get nothing to see at all in the dynamic textbox.
    Could anyone help me out here?
    Thanks in advance
    Last edited by Rapidfire107; 11-08-2004 at 09:47 PM.

  2. #2
    Junior Member
    Join Date
    Nov 2000
    Posts
    9
    ah very nifty :P Why thinking difficult when it can be so damn simple
    I'll try it rigth away, thanks!

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