User Guide
50 Chapter 3: Working with Components
Deleting components from Flash documents
To delete a component’s instances from a Flash document, you must delete the component from
the library by deleting the compiled clip icon. It isn’t enough to delete the component from the
Stage.
To delete a component from a document:
1.
In the Library panel, select the compiled clip (SWC) symbol.
2.
Click the Delete button at the bottom of the Library panel, or select Delete from the Library
options menu.
3.
In the Delete dialog box, click Delete to confirm the deletion.
Using code hints
When you are using ActionScript 2.0, you can use strict typing for a variable that is based on a
built-in class, including component classes. If you do so, the ActionScript editor displays code
hints for the variable. For example, suppose you type the following:
import mx.controls.CheckBox;
var myCheckBox:CheckBox;
myCheckBox.
As soon as you type the period after myCheckBox, Flash displays a list of methods and properties
available for CheckBox components, because you have designated the variable as type CheckBox.
For more information, see “Strict data typing” and “Using code hints” in Using ActionScript in
Flash.
Creating custom focus navigation
When a user presses the Tab key to navigate in a Flash application or clicks in an application, the
FocusManager class determines which component receives input focus. You don’t need to add a
FocusManager instance to an application or write any code to activate the Focus Manager.
If a RadioButton object receives focus, the Focus Manager examines that object and all objects
with the same
groupName value and sets focus on the object with the selected property set
to
true.
Each modal Window component contains an instance of the Focus Manager, so the controls on
that window become their own tab set. This prevents a user from inadvertently navigating to
components in other windows by pressing the Tab key.
To create focus navigation in an application, set the
tabIndex property on any components
(including buttons) that should receive focus. When a user presses the Tab key, the FocusManager
class looks for an enabled object whose
tabIndex value is greater than the current value of
tabIndex. Once the FocusManager class reaches the highest tabIndex property, it returns to 0.
For example, in the following code, the
comment object (probably a TextArea component)
receives focus first, and then the
okButton object receives focus:
var comment:mx.controls.TextArea;
var okButton:mx.controls.Button;