MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 420

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

If a Flash application is playing in a web browser, the application doesn't have focus until a user
clicks somewhere in the application. Also, once a user clicks in the Flash application, pressing Tab
can cause focus to jump outside the Flash application. To keep tabbing limited to objects inside
the Flash application in Flash Player 7 ActiveX control, add the following parameter to the
HTML
<object>
<param name="SeamlessTabbing" value="false"/>
Creating an application with the Focus Manager
The following procedure creates a focus scheme in a Flash application.
To create a focus scheme:
Drag the TextInput component from the Components panel to the Stage.
1.
In the Property inspector, assign it the instance name comment.
2.
Drag the Button component from the Components panel to the Stage.
3.
In the Property inspector, assign it the instance name okButton and set the label parameter
4.
to OK.
In Frame 1 of the Actions panel, enter the following:
5.
comment.tabIndex = 1;
okButton.tabIndex = 2;
focusManager.setFocus(comment);
function click(evt){
trace(evt.type);
}
okButton.addEventListener("click", this);
This code sets the tab ordering. Although the comment field doesn't have a focus ring, it has
initial focus, so you can start typing in the comment field without clicking on it.
Customizing the Focus Manager
You can change the color of the focus ring in the Halo theme by changing the value of the
style, as in this example:
themeColor
_global.style.setStyle("themeColor", "haloBlue");
The Focus Manager uses a FocusRect skin for drawing focus. This skin can be replaced or
modified and subclasses can override
FocusManager class (API)
Inheritance
MovieClip >
ActionScript Class Name
You can use the Focus Manager to specify the order in which components receive focus when a
user presses the Tab key to navigate in an application. You can also use the FocusManager class to
set a button in your document that receives keyboard input when a user presses Enter (Windows)
or Return (Macintosh).
tag:
UIComponent.drawFocus
UIObject class
mx.managers.FocusManager
to draw custom focus indicators.
>
UIComponent class
> FocusManager
FocusManager class
421

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents