First of all create a new
fla file save it with the name
time.fla
Select first frame and open the script window and
write the following code:-
mydate = new Date();
hours = mydate.getHours();
minutes = mydate.getMinutes();
seconds = mydate.getSeconds();
dtformat = hours + ":" + minutes + ":" + seconds; |
We have stored today's date in a variable named
"dtformat" and so we have to insert a text box on
stage and set its porperties to dynamic and give
it variable name "dtformat".
Now test your movie by pressing Ctrl+Enter and Voila
you have done it. But here you will see that the
date is displayed and not changing. For this you
have to refreash the movie so that it will retrieve
time again and again and you got a running time.
So for this, again go to your movie, select first
frame and insert a keyframe by pressing F6. and
write this code on second frame :-
Again test your movie by pressing Ctrl+Enter, and
now you will see a running time.