type = 'application/x-shockwave-flash'
data = 'http://sitepointstatic.com/flash/time.swf'
width = '400'
height = '400'
bgcolor = 'black'

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.

Georgina has more than fifteen years' experience writing and editing for web, print and voice. With a background in marketing and a passion for words, the time Georgina spent with companies like Sausage Software and sitepoint.com cemented her lasting interest in the media, persuasion, and communications culture.

Get your free chapter of Level Up Your Web Apps with Go

Get a free chapter of Level Up Your Web Apps with Go, plus updates and exclusive offers from SitePoint.

No Reader comments

Related books & courses
Available now on SitePoint Premium

Preview for $1