Flash Script – Dynamic Time in Flash

By Georgina Laidlaw

Download the sample files here.

1. Create a new movie with width=200 and height=75.

2. Create a text field, and name it "time".

3. Name the current layer "textfield".

4. Create a new layer above the current layer, and name it "actions".

4. Create two key frames in the actions layer.

5. Insert this action into the first key frame:

today = new Date();  

time = today.getHours() add ":" add today.getMinutes()  
add ":" add today.getSeconds();

6. In the second frame, insert this action:

gotoAndPlay (1); 

7. You're finished! Press ctrl+enter to test the movie.

No Reader comments



Because We Like You
Free Ebooks!

Grab SitePoint's top 10 web dev and design ebooks, completely free!

Instant Website Review

Use Woorank to analyze and optimize your website to improve your website to improve your ranking!

Run a review to see how your site can improve across 70+ metrics!

Get the latest in Front-end, once a week, for free.