Digital clock

how do i make a digital clock?

use the date object to get the time, then concatenate the different time properties you would like to display into one string. place a dynamic text box on the stage and give it the same variable name as the string containing the time information.
:slight_smile:
jeremy

could you give me an example

make a movie with 3 frames, then…
frame 1 actions:
_root.createTextField(“tTime”,1,50,20,100,50);
_root.tTimeFormat= new TextFormat();
_root.tTimeFormat.color = 0x000000;
frame 3 actions:
obDate = new Date();
sTime=obDate.getHours()+":"+obDate.getMinutes()+":"+obDate.getSeconds();
_root.tTime.text = sTime;
_root.tTime.setTextFormat(_root.tTimeFormat);
gotoAndPlay(_currentframe-1);

now test the movie. there should be a display there.
check out the reference for ‘createTextField’ and the methods for the ‘Date’ object for more information.
hope that helps…
:slight_smile:
jeremy

theres a tutorial on this site now. heres the url, if you have any quesitons, you can post, or e-mail me.

www.kirupa.com/developer/…_clock.asp

but isn’t that for flash 5 ?
:slight_smile:
jeremy

yes i wasn’t sure about the code differences but i thought that it would give that individual a place to start…