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

Hour 13. Rollovers > Task: Rollover Custom Cursor

Task: Rollover Custom Cursor

The custom cursor in the preceding task has one major flaw: It does not change when it rolls over a button like a real cursor does. We can fix this easily enough:

1.
Start with the movie you completed from the previous task, or use 13fulltimecursor.fla.

2.
Create a button at the root level. You should give the button different over and down states. See 13rollovercursor.fla for an example.

3.
In the cursor movie clip, make a few changes. First, add a second key frame to the movie clip. This should be similar to how the first key frame looks but with some sort of indicator to the user that the cursor is over a button. Figure 13.2 shows an example.

Figure 13.2. The second frame of the movie clip is used when the cursor is over a button.


4.
Name the two frames of the movie clip normal and over button.

5.
Place a stop(); command in the first frame of the movie clip to prevent it from animating between the two frames when the movie starts.

6.
At the root level, name the movie clip cursor.

7.
Place a script on the button that tells the cursor to change when it is over the button:

on (rollOver) {
    cursor.gotoAndStop("over button");
}

on (rollOut) {
    cursor.gotoAndStop("normal");
}

8.
Test the movie or use 13rollovercursor.fla.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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