STEP 10 setting the rolloff BEHAVIOR


STEP 10 setting the rolloff BEHAVIOR

You can now close the Instance Properties dialog and test your code. You can only test movie clips by choosing Control > Test Movie. Notice that although the rollover works fine, the movie clips don't revert when your pointer moves away from the button, as they should. To add the rolloff behavior, follow these steps:

  1. Select the keyframe in the button layer.

  2. Choose Modify > Instance.

  3. In the Instance Properties dialog, select the Actions tab and choose the final line in the Actions pane, which in this case is End On.

  4. Click the Add Action button and choose On MouseEvent.

  5. Select the Roll Off checkbox from the On MouseEvent options.

  6. From the Add Action button, select Tell Target and choose daveclip1.

  7. From the Add Action button, choose Go To and select the label. Enter the label name of the stop frame, in my case "davestop."

  8. Select the script line End Tell Target.

  9. Repeat steps 68, changing the parameters like this:

    • For Tell Target, choose filmclip1.

    • Select the Play action.

When you're finished, the script should resemble the one shown in figure 04:26.


Figure 04:26.

graphics/04fig26.jpg


The final bit of code I include is not necessary for the rollover effect, but is required if I want to use the buttons as navigational devices. Using the same process as described earlier, I add a third On Mouse event: On (Release). This event triggers when a user presses and releases a mouse button. The action taken is Get URL, which opens up a specified web page. The URL can be either absolute (such as http://www.yourURL.com/) or relative (as in products/index.html) and you can also specify the window in which you want it to appear. If you'd like to replace the current page, choose the _self window. Also, if you want the button to navigate within your Flash movie you can add a GoTo action on the release mouse event and simply specify the frame number or label you want to go to.



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