PLEASE note: These pages are here solely for historic purposes. New articles have not been written since 2001; many links in the index are broken; and most ahref.com email addresses will now bounce. Try visiting ep Productions, Incorporated, the web programming and development company behind this site.

Tip: Talk with other developers in the discussion forums.

web index ahref.com: a community space for web developers------ -----
IndexToolsCareersTalk
ahref.com > Guides > Design

Design Guide

Macromedia Flash Tutorial, Part II, Continued


Finishing Up

To get the time from the computer, we'll use three built-in JavaScript Methods: getSeconds, getMinutes and getHours. The seconds and minutes are manipulated in JavaScript to provide a separate tens (0-5) and units (0-9) digit for the seconds and minutes, and the hours are sent to the Hours Movie Clip in 24-hour format (0-23). For the seconds digit we use the following Flash Method in JavaScript to send a command for the correct information to Flash for immediate display.

jc().TGotoLabel('_level0/Clock/1Second', S1);

The function jc() is used to supply the correct object model, which is different for Internet Explorer than for Netscape. We use the Flash Method TGotoLabel(target,label), where target is the same type of Target used in Tell Targets in Flash and label is the Label given to a frame in Flash 3. The _level0 (underline level zero) in the target refers to the main Flash movie on level zero.

Similar to the hierarchy of files and directories, Flash has a hierarchy of timelines. To specify targets at different levels in the hierarchy, add a path to the target name using the same system as file paths or URLs. The main timeline is the top level and Movie clips on it are children of that timeline. Movie Clips inside other Movie Clips are called nested. In our example Movie Clip '1Second' is a child of Movie Clip 'Clock' on the main timeline in the Movie on level zero (hence /Clock/1Second). S1 is the JavaScript variable that shows seconds.


John Croteau (croteau@erols.com), a recognized expert in Flash creation, has been involved in Flash since the release of the beta for Flash 2. His Flash Tech Resource (http://www.FlashCentral.com/Tech/), now a part of Flash Central, is a useful technical information resource for Flash developers.

continue reading >>>
or jump to a topic:

Introduction
Using Buttons to Get User Input
Controlling the Timer
Adding Actions to Buttons
Keeping Accurate Time
Finishing Up
Flash Resources


view a printable version of this article


To suggest a topic, please email guides@ahref.com.

 


HOME ||| ABOUT AHREF.COM ||| ADVERTISE ||| FEEDBACK ||| SEARCH THIS SITE ||| CONTRIBUTE

© 1998-1999 ep Productions, Inc. All rights reserved. Terms of use.