Graphics Programs Reference
In-Depth Information
Let's spend a minute to scrub through the Timeline. Notice that as we advance from
one frame to the next that the object rotates clockwise as shown in Figure 8.4.
Conversely, as we scrub from right to left one frame at a time in the Timeline, the
object rotates in the opposite direction. We will use this information when we set up
the rotation script.
Figure 8.4 Images seen through scrubbing the Timeline
Step 3: Label the movie clip instance
Go to Scene 1, select the object layer, and then drag objectMC from the Library onto
the Stage. Use the Align window to center it on the Stage. In the Properties window,
label the instance of the movie clip object_mc .
Figure 8.5 Label the movie clip instance
Step 4: Initialize movie clip variables
Enter the script below in the first frame of the actions layer. The variable totalFrames
defines the number of frames used in the object movie clip. We don't need to remember
what the number is; Flash can look it up for us. The variable move will control whether
the frames in the object movie clip move forward or backward.
1
2
3
4
5
// set the number of frames in the object movie clip
// and the direction of frame movement in the clip
var totalFrames:Number = object_mc._totalframes;
var move:Number = 0;
Search WWH ::




Custom Search