STEP 11 the rollover script: controlling the LINE OBJECT


When creating a generic routine that affects more than one aspect of the movie, it's best to work on one area at a time. The first object I'll address is the line of simulated time-code, the Line object, that moves from right to left, above each button.

  1. Select the Set Property action from the Add Action list.

  2. From the Set drop-down list, choose a property to change and then enter a Target and a Value.

    In this example, I first change the X Position property of the Line object to a variable line_x. You'll see later that when I call this script from the navigation buttons , I give the line_x variable a value. Each navigation button will set this value to a different number. This is what makes the code reusable and flexible.

  3. Repeat step 2 for the Y Position property, with the same Target (/line) and line_y as the Value. When you're done, your Actions panel should look like the one in figure 08:24.


    Figure 08:24.

    graphics/08fig24.jpg


  4. From the Add Action list, select Tell Target.

    Begin Tell Target and End Tell Target are placed in the action list.

  5. Select Go To as the action from the Add Action list. Enter /line in the Target field.

  6. Enter 2 in the Frame Number text field and then select the Control:Go To and Play option.

    The /line object has a Stop action in frame 1, so going to frame 2 immediately plays the object.

    The complete code for the first section of the RolloverScript looks like this:

      Set Property ("/line", X Position) = line_x   Set Property ("/line", Y Position) = line_y   Begin Tell Target ("/line")   Go to and Play (2)   End Tell Target  


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