Keeping Track of Time with Flash MX
- It Works Like This
- Preparing to Work
- Using #include to Load ActionScript from a Text File
- Running Conditional Code with OnClipEvent
- The Time Zone Button Layer
- Using Functions to Repeat Common Tasks
- Keeping Time with the ActionScript Date Object
- Using Prototype to Extend the Date Object
- Updating in Real Time
- Updating the Mouse Time Zone
- Setting an Analogue Clock
- Setting a Row of Clocks
- Using setInterval to Update the Clocks
- Summary
- About This Article
What time is it?
This question has been mulled over by the world's greatest minds since the dawn of civilization. The answer is complex and raises more questions than it answers. The current time is the crucial variable in any dynamic web site. This project is going to explore the ActionScript Date object, and along the way, you'll discover a bit more about the history and politics of timekeeping.
It Works Like This
In Flash, the ActionScript Date object is a convenient way to group date and time variables. After an ActionScript date has been defined, it can be expressed in either UTC or local time.
In this project, you are going to build a Flash application that is driven by the properties and methods of the Date object. By the end of this tutorial, you will have done the following:
Centered the world map on the viewer's location
Compared Coordinated Universal Time with the local time in other zones
Added and subtracted dates and times
Built a real-time analogue clock for each zone