STEP 15 building the ROLLOUTSCRIPT


The second generic script called by the various buttons for the ManiFestival is RolloutScript. The RolloutScript implementation is interesting because it shows that you can use variables not only to control properties of an object, such as the X or Y Position, but also to determine which movie is going to be played . The RolloutScript also expands the use of the If-Else-End-If conditional statement.

In RolloutScript, there are two objects that are affected: the larger Subway /Tunnel movie across the top of the stage and the smaller Dancer movie clip. To re-create this script, follow these steps:

  1. In the Scripts object, insert a third keyframe further down the Timeline; exactly where it is doesn't matter.

  2. Double-click the keyframe to open the Frame Properties dialog. Label the object RolloutScript.

    The first action is to play either the tunnel or the subway movie.

  3. On the Actions panel, select Tell Target from the Add Actions list.

  4. In the Target field, enter the variable whichmovie.

    By targeting a variable, instead of a specific movie, each button can now determine the movie clip to be played or otherwise affected.

  5. Select the Go to option from the Add Actions list and change the frame number to 2.

    Be sure to select the Go To and Play option, if necessary.

    The first part of the RolloutScript is now complete and should look like the example in figure 08:28.


    Figure 08:28.

    graphics/08fig28.jpg




Flash Web Design The Art Of Motion Graphics
Flash Web Design oder: the art of motion graphics
ISBN: 3827256623
EAN: 2147483647
Year: 2005
Pages: 192

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net