Graphics Programs Reference
In-Depth Information
A similar test is used for the queen animation shown in Figure 7.37. Using a
trace(scene3D.Queen._xscale) statement, an appropriate scale was selected to
activate a bow to the user.
Figure 7.37 Screen shot of the queen animation
Unlike the guard animation that loops, we would like the queen to bow only once. In
the movie clip that contains her animation, there is a stop() command on the last
frame so that it will not loop automatically. When the scale factor is large enough, an
additional test is carried out that checks to see whether the current frame of the ani-
mation is less than the total number of frames in the animation. If it is, the animation
will continue. If it is not, the movie clip will go to the first frame.
107
108
109
110
111
112
113
114
// test to activate the queen animation
if (scene3D.Queen._xscale > 150)
{
if(scene3D.Queen._currentframe < scene3D.Queen._totalframes)
{scene3D.Queen.gotoAndPlay(scene3D.Queen._currentframe + 1);}
}
else { scene3D.Queen.gotoAndStop(1); }
Search WWH ::




Custom Search