Graphics Programs Reference
In-Depth Information
Step 4: Access the additional object frames
In our case we have a stop() command in the actions layer. This enables us to access
different frames individually and provides a convenient storage place to hold different
objects that we want to follow our circular path. We can access these frames quite eas-
ily when we duplicate the object movie clip with a simple one-line addition to our code.
22
23
24
25
26
27
28
// create the objects for the circular motion
for (var i:Number = 0; i < numberOfObjects; i++)
{
object_mc.duplicateMovieClip("object"+i, i);
this["object"+i].gotoAndStop(i+2);
}
As we loop over the number of objects that we want to create, we just tell the dupli-
cated movie clip to go to a different frame. For example, "object0" will go to frame 2,
"object1" will go to frame 3, and so forth.
Save your movie as 6_5_xzRotation3_DONE.fla and test it to make sure that you
have eight different objects rotating about the y-axis, as shown in Figure 6.16, and
that the speed of rotation is determined by the horizontal location of the cursor.
Figure 6.16 Rotation about the y-axis with multiple objects
 
Search WWH ::




Custom Search