Graphics Programs Reference
In-Depth Information
Exercise 8.2: Object Movie on a Circular Path
In this exercise, we will extend the previous exercise to include the object travelling in
a circular path as we did in Chapter 6. Our main challenge will be to relate the rotation-
al view of the object to its location on the circular path.
Step 1: Getting started
We'll begin where we left off, so open 8_1_objectVR1_DONE.fla in the Chapter 8
folder. Most of what we need has already been done in Chapter 6. Open 8_2_objectVR.
fla . It is a duplicate of the earlier Chapter 6 file xzRotation4.fla .
Copy object_mc in 8_1_objectVR1_DONE.fla and paste it into the object layer of the
file 8_2_objectVR.fla . Select the background layer and delete it.
Step 2: Make initial script changes
We have to modify the script in a few places to take into account that we have only
one object. Change the lines indicated below.
14
15
// set the number of objects to be created and startAngle
var numberOfObjects:Number = 1;
78
79
80
81
82
83
// loop over all the objects
for (var i:Number = 0; i < numberOfObjects; i++)
{
thisObj = object_mc;
placeObj(thisObj,i);
displayObj(thisObj);
Delete these lines, as they are no longer needed.
22
23
24
25
26
27
// create the objects for the circular motion
for (var i:Number = 0; i < numberOfObjects; i++)
{
this.createEmptyMovieClip("object"+i, i);
this["object"+i].loadMovie("vases/vase"+(i+1)+".png");
}
 
Search WWH ::




Custom Search