
Button._name Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
463
<Backspace>
<Delete>
<Down>
<End>
<Enter>
<Home>
<Insert>
<Left>
<PgDn>
<PgUp>
<Right>
<Space>
<Tab>
<Up>
In Flash 4, keyPress was the only means of interacting with the keyboard.
Usage
Unlike all other keyboard event-handling tools in ActionScript, the keyPress Button event
intercepts the default keyboard behavior in the Player. For example, if a button traps the
left arrow key via keyPress, the left arrow will not move the I-beam cursor in a text field.
on ( keyPress "<Left>" ) {
// We’re just blocking the <Left> key, but we must provide some code here
// or this function will get optimized out.
1 + 1;
}
See Also
Key.onKeyDown(), Key.onKeyUp()
Button._name Property
the instance name of the Button object
Flash 6
read/write
theButton._name
Description
The string _name property indicates theButton’s instance name, which is specified via the
Property inspector at authoring time. Though rarely (if ever) necessary, setting
_name reas-
signs the instance name for
theButton; thereafter, references to the old instance name yield
undefined.
More commonly, the
_name property is read, not written. For example, it can be used to
identify a specific button when one of many is clicked. The following function performs
different actions based on the calling button: ...