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

Lesson 7. Checking Input & Displaying Er... > Disabling the Hand Cursor Over Hotsp...

Disabling the Hand Cursor Over Hotspots

This simulation is coming together now. It involves the user and, when required, is aware of the user. One more interaction is needed, reflecting the task itself. Indeed, the simulation is successful in that it behaves a lot like the real task. That is, it almost behaves like the real task. The fact that the cursor turns into a hand as the user rolls over the hotspots is a problem. Fortunately, Flash MX has a property called useHandCursor that you can set to false. In this task you will prevent the cursor from turning to a hand over each of the invisible hotspot buttons.

Select the invisible button in frame 10, which is resting over the System DSN tab of the screenshot, and open the Actions panel.

You should see the standard script that you added in the previous lesson.

							on (release) {

This script advances the timeline when the button is clicked and released. Now, the hand cursor appears when the user rolls over the button. Rolling over and releasing the button are two different events, so the script that disables the hand cursor can't go inside the current block of code. It will have to go in its own on (rollover) event code block.

Looking up this property in the Reference panel, you can see that the following is listed as the syntax for the useHandCursor property.


The myButton part of the code refers to the instance name of the button. In Flash 5 and earlier, only movie clips can have instance names, but in Flash MX, you can add instance names to buttons and text fields as well. None of your buttons have instance names at this point.

With the invisible button in frame 10 still selected, enter systemdsn_btn as its instance name in the Property inspector.

You can give the instance any name you like, but I add the _btn as a suffix to the instance name to make it easier to identify the instance in scripts. I used systemdsn as the main name, because that is the area the hotspot is covering.

Return to the Actions panel and add the following script after the script that is already attached to the button.

							on (rollOver) {

Because the hand cursor appears only on rollover, you need to match that by triggering this script with a rollOver event.

I used 0 instead of false as the value of the expression to make the point that false and 0 are interchangeable when setting properties, as are true and 1. If you prefer, you can enter false instead of 0; it makes no difference to anyone but you.

The order of the two scripts doesn't matter, either. You could put the useHandCursor script above the gotoAndPlay() if you like. As long as the lines of code aren't intertwined, Flash sees each block as a separate entity, simply because they have different event handlers.

Proceed through the rest of the movie, giving each invisible button a unique instance name, and adding the useHandCursor script block to each button. Remember to enter the correct instance name in the script.

Again, adding this script block should have no effect on existing script blocks as long as you add it to a new line.

Test each of the new scripts by working through the movie and looking for that hand cursor to appear.



Not a subscriber?

Start A Free Trial

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