Graphics Programs Reference
In-Depth Information
Step 6: Make it stop
Okay, now that everything is moving properly, we really don't want it to go on forever.
Let's add a play button that we can use to start and stop the spinning. Add a new layer
above the mask layer and name it play button . Drag playBtn from the Library onto
the Stage and center it as shown in Figure 5.20. In the Properties window name the
instance play_btn and set its alpha value to 0.
Figure 5.20 Adding a play button
Now let's make a few additions to the script. Let's define a new function initAngles .
Inside the function we will set angle to 0 and define the maximum angle, maxAngle ,
that we will allow the ball and wheel to turn. It would be nice to vary the amount of
Search WWH ::




Custom Search