Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Flash MX action script bible - Reinhardt R.

Reinhardt R. Flash MX action script bible - Wiley & sons , 2004. - 987 p.
ISBN: 0-7645-4354-7
Download (direct link): macractionscriptbiblefeb2004.pdf
Previous << 1 .. 120 121 122 123 124 125 < 126 > 127 128 129 130 131 132 .. 427 >> Next

Another button-like behavior for MovieClip and Button objects is the automatic changing of the cursor icon when the user mouses over the object. When the user mouses over any enabled object with button event handler methods applied to it, the cursor icon becomes a hand icon. This default behavior is expected in most situations. However, you may want to modify this behavior in some circumstances. You can disable the hand cursor by setting the useHandCuror property to false. If you later want to re-enable the hand cursor, all you need to do is set the useHandCursor property to true again.
mcCircle.useHandCursor = false; // Turn off hand cursor.
Tab-Switching, Focus, and Menus
The Tab key allows a user to switch focus between graphical objects of a movie. Button, MovieClip, and TextField objects are all tab-switchable. By default, all Button objects, TextField objects, and MovieClip objects handling Button events are enabled for tab-switching; and the ordering is dependent solely upon the Flash Player’s own ordering. However, by taking advantage of the tabEnabled and tabIndex properties of graphical objects, you can determine which objects are tab-switchable, and in what order they should be switched.
The tabEnabled property of graphical objects can be set to either true or false. By default, it is undefined. When the value is either true or undefined, the object is included in the tab-switching for the movie. However, you can set the property to false to remove the object from those between which the user can tab. This is useful when you have objects within the movie that you do not want to be enabled for tab-switching. For example, if you create a form in Flash, you may well want the elements of the form to be enabled for tab-switching. These might include TextField objects, menu MovieClip objects, and Button objects. However, you may also have other MovieClip objects within the movie that are not part of the form.
By default, these objects would be included in the tab-switching. But you can disable them by setting their tabEnabled properties to false.
234
Part III ♦ MovieClip, Button, and Drawing API
Also, it can often be desirable to set the order in which objects are switched. By default, the order is determined by the objects’ coordinates within the movie. But this may not always be the order in which you want them to be switched. You can, therefore, set the tablndex property of each object to determine the order in which it will be switched. The tablndex property can be assigned any positive integer value, but it should be unique from that of any other object in the movie at that point in the timeline. If any object has a tablndex property defined, all other objects are removed from the tab-switching order.
Additionally, when Button and MovieClip objects are enabled for focus and have been selected, by default a yellow rectangle outlines the object of focus. This is intended so that a user can see where the focus is in a movie. However, you can turn off this focus rectangle with the _focusrect property. There is a global _focusrect property that allows you to turn off focus rectangles for the entire movie but not for individual objects.
_focusrect = false;
In addition, you can set this property for each graphical object individually so that some objects have focus rectangles when selected, and others do not:
mcCircle._focusrect = false;
The global _focusrect property is set to true by default. Each object’s _focusrect property has a null value by default. Either a null or a true value turns on the focus rectangle. Setting the property to false turns off the focus rectangle.
MovieClip-Specific Tab-Switching and Focus-Related Properties
MovieClip objects have two additional properties that deal with focus and tab-switching, which are not needed for Button objects. Because Button objects can receive focus by default, there is no need to ever specifically instruct them to be able to receive focus. MovieClip objects, on the other hand, are not able to receive focus in their default state. As stated in the previous section, MovieClip objects can receive focus when they have an attached event handler or event handler method for Button events. In other words, when MovieClip objects act like Button objects, they can receive focus. Additionally, by setting the tabIndex property of a MovieClip object, it will be included in the tab-switching order, regardless of whether or not it handles Button events. But you can also force a MovieClip object to be able to receive focus by setting the focusEnabled property to true. However, just by setting the focusEnabled property to true, the MovieClip object will not be included in the tab-switching order. In this manner, the only way to get the object to receive focus is through the Selection.setFocus() method (discussed in more detail in Chapter 17):
mcCircle.focusEnabled = true;
Selection.setFocus(mcCircle);
When a MovieClip object has nested, or child, graphical objects that are tab-switching-enabled, they are automatically included in the automatic tab ordering (if no tabIndex properties have been set for any of the graphical objects). It may be the case, however, that you would desire that they not be included in the tab order. For example, it might be that the children of a MovieClip are menu items for a menu MovieClip, and you want for the Tab key to switch between menus, but not the items of the menus. In that case, you would want to set the tabChildren property of the parent MovieClip object to false. The property is undefined, by default. If it is either undefined or set to true, the child objects of the MovieClip object are included in the automatic tab ordering.
Previous << 1 .. 120 121 122 123 124 125 < 126 > 127 128 129 130 131 132 .. 427 >> Next