• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter FOUR. HILLMANCURTIS.com NAVIGATI... > 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:

Select the keyframe in the button layer.

Choose Modify > Instance.

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.

Click the Add Action button and choose On MouseEvent.

Select the Roll Off checkbox from the On MouseEvent options.

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

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

Select the script line End Tell Target.

Repeat steps 6–8, 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.

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.

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint