ActionScript 2.0 Components Language Reference |
|
|
|
| FocusManager class > Using Focus Manager > Creating an application with Focus Manager | |||
The following procedure creates a focus scheme in a Flash application.
To create a focus scheme:
comment.tabIndex = 1;
okButton.tabIndex = 2;
focusManager.setFocus(comment);
function click(evt){
trace(evt.type);
}
okButton.addEventListener("click", this);
The code sets the tab ordering. Although the comment field doesn't have an initial focus ring, it has initial focus, so you can start typing in the comment field without clicking in it. Also, you have to select the Disable Keyboard Shortcuts menu option for focus to work properly in test mode.
|
|
|
|