User Guide

724 FocusManager class
// Let Focus Manager know mc has children;
// this overrides mc.focusEnabled=true;
mc.tabChildren=true;
mc.tabEnabled=false;
// Set the tabbing sequence.
txt1.tabIndex = 1;
txt2.tabIndex = 2;
mc.grid1.tabIndex = 3;
mc.txt3.tabIndex = 4;
// Set initial focus to txt1.
txt1.text = "focus";
focusManager.setFocus(txt1);
If your movie clip doesnt have an onPress or onRelease method or a tabEnabled property,
it wont be seen by the Focus Manager unless you set
focusEnabled to true. Input text fields
are always in the tab scheme unless they are disabled.
If a Flash application is playing in a web browser, the application doesnt 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> tag:
<param name="SeamlessTabbing" value="false"/>
Creating an application with Focus Manager
The following procedure creates a focus scheme in a Flash application.
To create a focus scheme:
1. Drag the TextInput component from the Components panel to the Stage.
2. In the Property inspector, assign it the instance name comment.
3. Drag the Button component from the Components panel to the Stage.
4. In the Property inspector, assign it the instance name okButton and set the label parameter
to OK.
5. In Frame 1 of the Actions panel, enter the following:
comment.tabIndex = 1;
okButton.tabIndex = 2;
focusManager.setFocus(comment);
function click(evt){
trace(evt.type);
}
okButton.addEventListener("click", this);