User Guide

14 Flash 4 ActionScript Primer
You can also call code that resides on another timeline, such as a movie clips timeline. To
execute the code, specify the movie clip instance name followed by a colon, and then the
frame number or label. For example, the following ActionScript calls the code that resides on
the frame labeled
moveUp in the movie clip instance named callClip:
call("callClip:moveUp");
This technique is often used to create call clips or function clips—movie clips whose sole
purpose is to encapsulate regularly used code. A call clip contains a keyframe for each function
you want to create. You typically label each keyframe according to its purpose. Macromedia
also recommends that you create a new layer for each new keyframe, and that you give each
layer the same name as the frame label you assign to the keyframe.
The following figure shows the Timeline of an example call clip. The first keyframe of a call
clip always contains a
stop() action, which ensures that the playhead doesnt continually loop
over the frames in its Timeline. Subsequent keyframes contain code for eachfunction.” Each
function keyframe is labeled to identify what it does. To make editing and viewing the call
clip easier, each function keyframe is typically inserted on a separate layer.
The following procedure explains how to create and use a call clip.
To create and use a call clip:
1. In Flash Professional 8, create a new document from the Flash Lite 1.1 Symbian Series 60
document template.
2. Select Insert > New Symbol.
3. In the Create New Symbol dialog box, type Call Clip in the Name text box, and then
click OK.
The movie clip opens in editing mode.
Frame labels
Each keyframe contains code.
First keyframe contains stop() action