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 .. 356 357 358 359 360 361 < 362 > 363 364 365 366 367 368 .. 427 >> Next

788
Part IX ♦ Working with Flash in Other Environments
Accessible Components
Some of the new components provided with Flash MX 2004 support accessibility. In order for the component to work with screen-readers, special ActionScript must be written into the component.
The components built with accessibility options include:
♦ Button (or SimpleButton)
♦ CheckBox
♦ RadioButton
♦ Label
♦ TextInput
♦ TextArea
♦ ComboBox
♦ ListBox
♦ Window
♦ Alert
♦ DataGrid
These components have specialized ActionScript that enables screen-readers to recognize and read out the content of the components.
Tabbing
Allowing your users to use the Tab and Enter buttons for navigation is very important when constructing an accessible Web site. They are common tools used for navigation by for those who use screen-readers. You might also find it a very efficient method of navigation, regardless of your abilities. As in the past, Flash Players 6 and 7 automatically enable tabbing through text input boxes, buttons, and Movie Clips. The order is random, or “automatic,” by default, although you can control the order of tabbing through the movie, thus increasing the logical progression through the objects or pages. Tabbing through a movie produces a yellow rectangle around each object as it progresses through, which is called the focusrect, short for “focus rectangle.” It is possible to disable tabbing, the focusrect, and even certain objects from being “tab-able” if you do not want this functionality or if you want to alter it.
Setting the tab order benefits the accessibility of your movie and flow in data entry immensely. You cannot tab static text or graphics — unless, of course, you nest the items with Movie Clips. It is possible for your users to also use the arrow keys to move among the tab-able objects after they have pressed the Tab button once. The users must have the browser window and Flash movie in focus in order to be able to tab.
Using Keypress Actions
It is very important to understand the dependency that many screen-reader users place on the use of navigation based on keyboard commands. A button’s onRelease() handler executes when the Enter key is pressed while the tab focus is on the button. To make a movie
Chapter 32 ♦ Making Movies Accessible and Universal
789
easily accessible to screen-reader users, you might want to design navigation using the Key class instead of mouse clicks or the Tab/Enter keys. Relying on tabbing and the Enter key might be enough functionality for you, although you might want some elements to execute on a certain combination of keys being pressed.
For a detailed description on how to use keypress actions in your movie, see Chapter 19.
The first thing you should do is make sure that each of your buttons or Movie Clips in your movie specifies the keypress you want to associate with it. You can put the shortcut in the Shortcut box of the associated Accessibility panel, making sure it is written with names spelled out (no symbols), using uppercase letters for letters, and joined by a + sign, such as Ctrl+N.
To apply keypress actions to your movies, you can place Key l isteners that the movie will process when it loads. A sample of the code using the Key class is as follows:
var oNavKey:Object = new Object(); oNavKey.onKeyDown = function():Void { if (Key.getCode() == Key.UP) { root.gotoAndStop("newpage");
}
};
Key.addListener(oNavKey);
stop();
As you can see, when the up arrow key is pressed, you are taken to the frame labeled newpage.
Detecting and Controlling Accessibility Options with ActionScript
The Accessibility class is available in Flash Player 6 or higher, and it’s relatively simple to use — primarily because only two methods are associated with it: Accessibility .isActive() and Accessibility.updateProperties(). Like the Stage, Mouse, and Key classes, the Accessibility class is static. You don’t use any new constructor to create new instances. Rather, you simply address the class’s functionality directly through its class name.
Note The Accessibility.updateProperties() method is available only in Flash Player 6
r65 or later. Early releases of Flash Player 6 do not support this method.
Checking the State and Presence of a Screen-Reader
The Accessibility.isActive() method makes the player check to see whether the user is actively using a screen-reader on the computer and returns a Boolean value of true or false. This code enables you to enable or disable certain elements within the content of your Flash document based on the information returned. For instance, you might want to disable background music in your movie, thus leaving the focus on the speech generated by the screen-reader. You might also want keypress actions available only to the users who are using a screen-reader.
790 Part IX ♦ Working with Flash in Other Environments
The Flash Player requires time to initiate a connection to the screen-reader at the start of a Flash movie. Therefore, you have to build a slight delay into your movies if you use this method to check for a reader. If you can, set up any other movie attributes first, check for the screen-reader at the last possible moment, and then perform any other actions you require to customize your movie. You can use the setInterval() function to delay the use of Accessibility.isActive() as well.
Previous << 1 .. 356 357 358 359 360 361 < 362 > 363 364 365 366 367 368 .. 427 >> Next