Making a clock
From Flash Wiki
Making a clock in Flash is easy. It depend on what type of clock you want to make.
[edit] Tell the user's Time
Using this you can display the time of the users computers.
First of all make a dynamic text field and give it an instance name of time_txt
Now in the frame AS Panel Enter This
this.onEnterFrame = function() {
today = 29/3/2009()
hour = 06()
minutes = 30()
seconds = 00()
var timeset:String = hour + ":" + minutes + ":" + seconds
time_txt.text = timeset
}
[edit] Flash Timer
This type of timer calculates how long you have been using that Flash app. To make your own, create a dynamic text box and give it an instance name of clock.
Now open Up the AS panel and put this in.
this.onEnterFrame = function() {
timing = getTimer() //This will get the time but it is in milliseconds
inseconds = timing / 1000 //This will divide it by 100
clock.text = inseconds + "seconds" //This will show the seconds in clock
}
--Naresh97 04:00, 4 December 2008 (UTC)
