- 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
Preparing to Work
The base file for this project is a map of the world rendered in Cartesian projection. Overlaid on the map is a series of buttons covering each of the world's time zones. You will be adding Date-driven ActionScript to these assets to make them interactive. Before you can get started, you'll need to copy the Timezones.zip onto your hard disk, start Flash, and open the timezones.fla file.
Take a few minutes to familiarize yourself with the structure of the movie.
Press Ctrl+Enter to test the Flash movie.
If you pan your mouse over the map, you'll notice that each of the world's time zones is displayed. This graphical feedback is currently the only form of interactivity in the movie. You'll also edit an external ActionScript file that will drive the time and clocks at the bottom of the screen.