MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual page 419

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

Advertisement

To create a button that receives focus when a user presses Enter (Windows) or Return
(Macintosh), set the
desired button, as shown here:
focusManager.defaultPushButton = okButton;
Note: The Focus Manager is sensitive to when objects are placed on the Stage (the depth order of
objects) and not their relative positions on the Stage. This is different from the way Flash Player
handles tabbing.
Using the Focus Manager to allow tabbing
You can use the Focus Manager to create a scheme that allows users to press the Tab key to cycle
through objects in a Flash application. (Objects in the tab scheme are called tab targets.) The
Focus Manager examines the
order to locate the objects.
A movie clip can be either a container of tab targets, a tab target itself, or neither:
Movie clip type
Container of tab targets
Tab target
Neither
Note: This is different from the default Flash Player behavior, in which a container's
property can be
undefined
Consider the following scenario. On the Stage of the main Timeline are two text fields (
) and a movie clip (
txt2
(
). You would use the following code to allow users to press Tab and cycle through the
txt3
objects in the following order:
Note: The FocusManager and TextField instances are enabled by default.
// 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 doesn't have an
won't be seen by the Focus Manager unless you set
always in the tab scheme unless they are disabled.
420
Chapter 6: Components Dictionary
FocusManager.defaultPushButton
tabEnabled
tabEnabled
false
true
false
.
) that contains a DataGrid component (
mc
,
,
txt1
txt2
onPress
property to the instance name of the
and
properties of the objects' parents in
tabChildren
,
.
grid1
txt3
or
method or a
onRelease
focusEnabled
tabChildren
true
false
false
tabChildren
) and another text field
grid1
property, it
tabEnabled
to
. Input text fields are
true
and
txt1

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?

This manual is also suitable for:

Flash mx

Table of Contents