Package | flash.text |
Class | public final class StageText |
Inheritance | StageText EventDispatcher Object |
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
This class enables mobile applications to gather user input using native text input controls on mobile devices. Input controls on mobile devices often have extensive user interfaces and supporting behaviors that don't exist on the desktop. For example, many mobile devices support text input features like the following:
The underlying operating system (or a component library bundled with the operating system) draws native text input fields. Native text input fields provide an experience that is familiar to anyone who has used other applications on the same device. However, because the operating system draws the text input fields instead of the player, you cannot use embedded fonts.
AIR profile support: This feature is supported on iOS and Android platforms. StageText uses native text input fields on Android and iOS mobile devices. On other platforms, StageText uses the Flash Runtime TextField.
When native inputs are used, StageText objects are not display objects
and you cannot add them to the Flash display list. Instead, you display a
StageText object by attaching it directly to a stage using the stage
property. The StageText instance attached to a stage is displayed on top of
any Flash display objects. You control the size and position of the rendering
area with the viewPort
property. There is no way to control
depth ordering of different StageText objects. Overlapping two instances
is not recommended.
When a StageText object has focus, it has the first opportunity to handle keyboard input. The stage to which the StageText object is attached does not dispatch any keyboard input events.
Because the StageText class wraps a different native control on every platform, its features are supported to varying degrees by each platform. Where features are supported, they may behave differently between platforms. When you attempt to use a particular feature on a particular platform, it is best to test the behavior. Only on desktop platforms where native controls are not used is StageText behavior similar to Flash Runtime text behavior.
StageText on Apple TV takes focus by default. To manage focus between different objects in your application keep a note of below points:
Property | Defined by | ||
---|---|---|---|
autoCapitalize : String
Controls how a device applies auto capitalization to user input.
| StageText | ||
autoCorrect : Boolean
Indicates whether a device auto-corrects user input for spelling or
punctuation mistakes.
| StageText | ||
clearButtonMode : String
[write-only]
The mode of clearButton for the current StageText Object.
| StageText | ||
color : uint
Specifies text color.
| StageText | ||
constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | ||
contentType : String
Provides a hint to the operating system as to the type of content for the text input field.
| StageText | ||
displayAsPassword : Boolean
Indicates whether the text field is a password text field.
| StageText | ||
editable : Boolean
Indicates whether the user can edit the text field.
| StageText | ||
fontFamily : String
Indicates the name of the current font family.
| StageText | ||
fontPosture : String
Specifies the font posture, using constants defined in the FontPosture class.
| StageText | ||
fontSize : int
The size in pixels for the current font family.
| StageText | ||
fontWeight : String
Specifies the font weight, using constants defined in the FontWeight class.
| StageText | ||
locale : String
Indicates the locale of the text.
| StageText | ||
maxChars : int
Indicates the maximum number of characters that a user can enter into the text field.
| StageText | ||
multiline : Boolean
[read-only]
Indicates whether the StageText object can display more than one line of
text.
| StageText | ||
prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | ||
restrict : String
Restricts the set of characters that a user can enter into the text field.
| StageText | ||
returnKeyLabel : String
Indicates the label on the Return key for devices that feature a soft keyboard.
| StageText | ||
selectionActiveIndex : int
[read-only]
The zero-based character index value of the last character in the current selection.
| StageText | ||
selectionAnchorIndex : int
[read-only]
The zero-based character index value of the first character in the current selection.
| StageText | ||
softKeyboardType : String
Controls the appearance of the soft keyboard.
| StageText | ||
stage : Stage
The stage on which this StageText object is displayed.
| StageText | ||
text : String
The current text in the text field.
| StageText | ||
textAlign : String
Indicates the paragraph alignment.
| StageText | ||
viewPort : Rectangle
The area on the stage in which the StageText object is displayed.
| StageText | ||
visible : Boolean
Indicates whether the StageText object is visible.
| StageText |
Method | Defined by | ||
---|---|---|---|
StageText(initOptions:StageTextInitOptions = null)
Creates a StageText object.
| StageText | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener
receives notification of an event.
| EventDispatcher | ||
Assigns focus to the StageText object.
| StageText | ||
Dispatches an event into the event flow.
| EventDispatcher | ||
Disposes of the StageText object.
| StageText | ||
Draws the StageText's view port to a bitmap.
| StageText | ||
Checks whether the EventDispatcher object has any listeners registered for a specific type
of event.
| EventDispatcher | ||
Indicates whether an object has a specified property defined.
| Object | ||
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | ||
Indicates whether the specified property exists and is enumerable.
| Object | ||
Removes a listener from the EventDispatcher object.
| EventDispatcher | ||
Selects the text specified by the index values of the first and last characters.
| StageText | ||
Sets the availability of a dynamic property for loop operations.
| Object | ||
Returns the string representation of this object, formatted according to locale-specific conventions.
| Object | ||
Returns the string representation of the specified object.
| Object | ||
Returns the primitive value of the specified object.
| Object | ||
Checks whether an event listener is registered with this EventDispatcher object or any of
its ancestors for the specified event type.
| EventDispatcher |
Event | Summary | Defined by | ||
---|---|---|---|---|
[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active. | EventDispatcher | |||
Dispatched after text content changes. | StageText | |||
Dispatched after setting a non-null stage and non-empty viewPort. | StageText | |||
[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive. | EventDispatcher | |||
Dispatched when the user is editing text, and the control has keyboard focus. | StageText | |||
Dispatched when the user is no longer editing text, and the control no longer has keyboard focus. | StageText | |||
Dispatched when the user presses a key. | StageText | |||
Dispatched when the user releases a key. | StageText | |||
Dispatched after the soft keyboard is activated, as a result of the StageText object acquiring focus. | StageText | |||
Dispatched before soft keyboard activation, as a result of the StageText object acquiring focus. | StageText | |||
Dispatched after the soft keyboard is deactivated, as a result of the StageText object losing focus. | StageText |
autoCapitalize | property |
autoCapitalize:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Controls how a device applies auto capitalization to user input. Valid values are defined as constants in the AutoCapitalize class:
This property is only a hint to the underlying platform, because not all devices and operating systems support this functionality.
Note: If you enable autoCapitalize
while text is being edited or otherwise in focus,
the updated behavior isn't applied until focus is released and reestablished.
The default value is AutoCapitalize.NONE
.
public function get autoCapitalize():String
public function set autoCapitalize(value:String):void
ArgumentError — If set to any value which is not a member of AutoCapitalize
|
See also
autoCorrect | property |
autoCorrect:Boolean
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates whether a device auto-corrects user input for spelling or punctuation mistakes.
This property is only a hint to the underlying platform, because not all devices and operating systems support this functionality.
Note: If you enable autoCorrect
while text is being edited or otherwise in focus,
the updated behavior isn't applied until focus is released and reestablished.
The default value is false
.
public function get autoCorrect():Boolean
public function set autoCorrect(value:Boolean):void
clearButtonMode | property |
clearButtonMode:String
[write-only]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 23 |
The mode of clearButton for the current StageText Object. There are four modes associated with this property:
StageTextClearButtonMode.WHILE_EDITING
StageTextClearButtonMode.NEVER
StageTextClearButtonMode.ALWAYS
StageTextClearButtonMode.UNLESS_EDITING
clearButtonMode
property is set as StageTextClearButtonMode.WHILE_EDITING
.
Note: This property is supported for iOS only.
Implementation public function set clearButtonMode(value:String):void
color | property |
color:uint
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Specifies text color. You specify text color as a number containing three 8-bit RGB components.
The first component represents red, the second represents green, and the third component represents blue.
For example, 0xFF0000
specifies red, 0x00FF00
specifies green, and
0x0000FF
specifies blue. The default text color is black (0x000000
).
The default value is 0x000000
.
public function get color():uint
public function set color(value:uint):void
contentType | property |
contentType:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 51.0 |
Provides a hint to the operating system as to the type of content for the text input field.
This can be used to adjust the behaviour or provide auto-completion hints, depending on the operating system. It can also result in the OS providing the option to insert a one-time-password that has just been received via SMS.
The default is for no special behaviour to be set, which is represented by a null value.
Implementation public function get contentType():String
public function set contentType(value:String):void
See also
displayAsPassword | property |
displayAsPassword:Boolean
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates whether the text field is a password text field. If true
,
the text field hides input characters using a substitute character (for example, an
asterisk).
Note: If you enable displayAsPassword
while text is being edited or otherwise in focus,
the updated behavior isn't applied until focus is released and reestablished.
Important: On iOS, a multiline stage text object does not display substitute
characters even when the value of this property is true
.
The default value is false
.
public function get displayAsPassword():Boolean
public function set displayAsPassword(value:Boolean):void
editable | property |
editable:Boolean
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates whether the user can edit the text field.
The default value is true
.
public function get editable():Boolean
public function set editable(value:Boolean):void
fontFamily | property |
fontFamily:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates the name of the current font family. A value of
null indicates the system default. To enumerate the available
fonts, use flash.text.Font.enumerateFonts()
. If the
font family is unknown, the default font family is used.
The default value is null
.
public function get fontFamily():String
public function set fontFamily(value:String):void
fontPosture | property |
fontPosture:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Specifies the font posture, using constants defined in the FontPosture class.
The default value is FontPosture.NORMAL
.
public function get fontPosture():String
public function set fontPosture(value:String):void
ArgumentError — If set to any value which is not a member of FontPosture
|
See also
fontSize | property |
fontSize:int
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
The size in pixels for the current font family.
The default value is 12
.
public function get fontSize():int
public function set fontSize(value:int):void
fontWeight | property |
fontWeight:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Specifies the font weight, using constants defined in the FontWeight class.
The default value is FontWeight.NORMAL
.
public function get fontWeight():String
public function set fontWeight(value:String):void
ArgumentError — If set to any value which is not a member of FontWeight
|
See also
locale | property |
locale:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates the locale of the text. StageText uses the standard locale identifiers. For example "en", "en_US" and "en-US" are all English; "ja" is Japanese. See iso639-2 code list for a list of locale codes.
The default value is en
.
public function get locale():String
public function set locale(value:String):void
maxChars | property |
maxChars:int
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates the maximum number of characters that a user can enter into the text field.
A script can insert more text than maxChars
allows. If maxChars
equals zero, a user can enter an unlimited amount of text into the text field.
The default value is 0
.
public function get maxChars():int
public function set maxChars(value:int):void
multiline | property |
multiline:Boolean
[read-only]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates whether the StageText object can display more than one line of
text. Read-only. This value matches that of the multiline
property in the StageTextInitOptions object used during construction.
public function get multiline():Boolean
See also
restrict | property |
restrict:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Restricts the set of characters that a user can enter into the text field.
The system scans the restrict
string from left to right.
The value of restrict
specifies the following text input restriction rules:
null
, a user can enter any character.\u
escape sequence to construct a restrict
string.Special Characters:
Use a backslash to enter a caret (^) or dash (-) character verbatim. The accepted backslash sequences are \-, \^ and \\. The backslash must be an actual character in the string. When you specify a backslash in ActionScript, use a double backslash.
Examples of restrict
property settings:
The following example allows a user to enter only the dash (-) and caret (^) characters:
my_txt.restrict = "\\-\\^";
The following example allows a user to enter only uppercase characters, spaces, and numbers:
my_txt.restrict = "A-Z 0-9";
The following example excludes only lowercase letters:
my_txt.restrict = "^a-z";
The following example allows a user to enter only uppercase letters, but excludes the uppercase letter Q:
my_txt.restrict = "A-Z^Q";
The following example allows a user to enter only the characters from ASCII 32 (space) to ASCII 126 (tilde).
my_txt.restrict = "\u0020-\u007E";
Note: Restrictions apply only to user input; a script can insert any characters into the text field.
The default value is null
.
public function get restrict():String
public function set restrict(value:String):void
returnKeyLabel | property |
returnKeyLabel:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates the label on the Return key for devices that feature a soft keyboard.
The available values are constants defined in the ReturnKeyLabel
class:
This property is only a hint to the underlying platform, because not all devices and operating systems support these values. This property has no affect on devices that do not feature a soft keyboard.
The default value is ReturnKeyLabel.DEFAULT
.
public function get returnKeyLabel():String
public function set returnKeyLabel(value:String):void
ArgumentError — If set to any value which is not a member of ReturnKeyLabel
|
See also
selectionActiveIndex | property |
selectionActiveIndex:int
[read-only]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
The zero-based character index value of the last character in the current selection. For example, the first character is 0, the second character is 1, and so on.
If no text is selected, this method returns the insertion point. If the StageText instance does not have focus, this method returns -1.
On iOS, this property is not supported for for non-multiline StageText objects and returns -1.
Implementation public function get selectionActiveIndex():int
See also
selectionAnchorIndex | property |
selectionAnchorIndex:int
[read-only]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
The zero-based character index value of the first character in the current selection. For example, the first character is 0, the second character is 1, and so on.
If no text is selected, this method returns the insertion point. If the StageText instance does not have focus, this method returns -1.
On iOS, this property is not supported for for non-multiline StageText objects and returns -1.
Implementation public function get selectionAnchorIndex():int
See also
softKeyboardType | property |
softKeyboardType:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Controls the appearance of the soft keyboard.
Devices with soft keyboards can customize the keyboard's buttons
to match the type of input expected. For example, if numeric
input is expected, a device can use SoftKeyboardType.NUMBER
to
display only numbers on the soft keyboard.
Valid values are defined as constants in the SoftKeyboardType class:
These values serve as hints, to help a device display the best keyboard for the current operation.
The default value is SoftKeyboardType.DEFAULT
.
public function get softKeyboardType():String
public function set softKeyboardType(value:String):void
ArgumentError — If set to any value which is not a member of SoftKeyboardType
|
See also
stage | property |
stage:Stage
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
The stage on which this StageText object is displayed.
Set stage
to null
to hide this StageText object.
The default value is null
.
public function get stage():Stage
public function set stage(value:Stage):void
text | property |
text:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
The current text in the text field. The carriage return character
('\r'
, ASCII 13) separates lines of text.
Text contained in this property is unformatted (it has no
formatting tags).
The default value is null
.
public function get text():String
public function set text(value:String):void
textAlign | property |
textAlign:String
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates the paragraph alignment. Valid values are defined as constants in the TextFormatAlign class:
Not all platforms support every textAlign
value.
For unsupported textAlign
values, platforms use
the default value (TextFormatAlign.START
).
The default value is TextFormatAlign.START
.
public function get textAlign():String
public function set textAlign(value:String):void
ArgumentError — If set to any value which is not a member of TextFormatAlign
|
See also
viewPort | property |
viewPort:Rectangle
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
The area on the stage in which the StageText object is displayed. The default is the zero rect.
Implementation public function get viewPort():Rectangle
public function set viewPort(value:Rectangle):void
RangeError — The Rectangle value is not valid.
|
visible | property |
visible:Boolean
[read-write]
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Indicates whether the StageText object is visible. StageText objects that are not visible are disabled.
Implementation public function get visible():Boolean
public function set visible(value:Boolean):void
StageText | () | constructor |
public function StageText(initOptions:StageTextInitOptions = null)
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Creates a StageText object.
The StageText object is invisible until it is attached to a stage and until the viewPort
property is set.
initOptions:StageTextInitOptions (default = null )
|
assignFocus | () | method |
public function assignFocus():void
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Assigns focus to the StageText object. For non-editable objects,
assignFocus()
does nothing.
dispose | () | method |
public function dispose():void
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Disposes of the StageText object.
Calling dispose()
is optional. If you do not maintain a reference to this
StageText instance, it is eligible for garbage collection. Calling dispose()
can make garbage collection occur sooner, or occur at a more convenient time.
drawViewPortToBitmapData | () | method |
public function drawViewPortToBitmapData(bitmap:BitmapData):void
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3.0 |
Draws the StageText's view port to a bitmap.
Capture the bitmap and set the stage to null
to
display the content above the StageText object.
The bitmap is typically the same width and height as the viewport. Starting with AIR 15.0, when the
player is on HiDPI displays, the bitmap's width and height can optionally be
contentsScaleFactor
times the width and height of the viewport. For instance, on a Mac
Retina Display, contentsScaleFactor
is 2, because the pixel resolution of the stage is
doubled, so the bitmap can correspondingly be twice the size of the viewport.
If you call this method before the Event.COMPLETE
event, the method could draw the
view port incorrectly.
bitmap:BitmapData — The BitmapData object on which to draw the visible portion of the StageText's view port.
|
ArgumentError — The bitmap's width or height is different from view port's width or height.
|
|
Error — The bitmap is null.
|
selectRange | () | method |
public function selectRange(anchorIndex:int, activeIndex:int):void
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Selects the text specified by the index values of the first and last characters.
You specify the first and last characters of the selection in the
anchorIndex
and activeIndex
parameters. If both parameter
values are the same, this method sets the insertion point.
On iOS, for non-multiline StageText objects, this function is not supported and always returns -1. If you call this method selecting the complete text string, the selection is visible. However, if you call this method selecting a subset of the text string, the selection is not visible.
For some devices or operating systems, the selection is only visible when the StageText object has focus.
ParametersanchorIndex:int — The zero-based index value of the first character in the selection
(the first character's index value is 0).
|
|
activeIndex:int — The zero-based index value of the last character in the selection.
|
See also
change | event |
flash.events.Event
flash.events.Event.CHANGE
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched after text content changes. This event can be dispatched on every change, or not until a set of changes is completed.
The Event.CHANGE
constant defines the value of the type
property of a change
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | true |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The object that has had its value modified.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event. |
complete | event |
flash.events.Event
flash.events.Event.COMPLETE
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched after setting a non-null stage and non-empty viewPort. Indicates
that the implementation has finished laying out the StageText object, and
you can now call the drawViewPortToBitmapData
method.
Depending upon the platform, this event could be dispatched synchronously or
asynchronously with the setting of the stage
, viewPort
, or both.
The Event.COMPLETE
constant defines the value of the type
property of a complete
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The network object that has completed loading. |
focusIn | event |
flash.events.FocusEvent
flash.events.FocusEvent.FOCUS_IN
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched when the user is editing text, and the control has keyboard focus.
Defines the value of the type
property of a focusIn
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | true |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
keyCode | 0; applies only to keyFocusChange events. |
relatedObject | The complementary InteractiveObject instance that is affected by the change in focus. |
shiftKey | false ; applies only to keyFocusChange events. |
target | The InteractiveObject instance that has just received focus.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.
|
direction | The direction from which focus was assigned. This property reports
the value of the direction parameter of the assignFocus() method of the stage.
If the focus changed through some other means, the value will always be FocusDirection.NONE .
Applies only to focusIn events. For all other focus events the value will be
FocusDirection.NONE . |
focusOut | event |
flash.events.FocusEvent
flash.events.FocusEvent.FOCUS_OUT
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched when the user is no longer editing text, and the control no longer has keyboard focus.
Defines the value of the type
property of a focusOut
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | true |
cancelable | false ; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
keyCode | 0; applies only to keyFocusChange events. |
relatedObject | The complementary InteractiveObject instance that is affected by the change in focus. |
shiftKey | false ; applies only to keyFocusChange events. |
target | The InteractiveObject instance that has just lost focus.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event.
|
keyDown | event |
flash.events.KeyboardEvent
flash.events.KeyboardEvent.KEY_DOWN
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched when the user presses a key.
Mappings between keys and specific characters vary by device and operating system. This event type is generated after such a mapping occurs but before the processing of an input method editor (IME). IMEs are useful for entering characters that the standard QWERTY keyboard is ill-equipped to produce (for example, Chinese ideographs).
This event occurs before the keyUp
event.
This event is not dispatched for all keys. The keys that cause this event to be dispatched vary by platform.
In AIR, canceling this event prevents the character from being entered into a text field.
The KeyboardEvent.KEY_DOWN
constant defines the value of the type
property of a keyDown
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | true |
cancelable | true in AIR, false in Flash Player;
in AIR, canceling this event prevents the character from being entered into a text field. |
charCode | The character code value of the key pressed or released. |
commandKey | true on Mac if the Command key is active. Otherwise, false |
controlKey | true on Windows and Linux if the Ctrl key is active. true on Mac if either the Control key is active. Otherwise, false |
ctrlKey | true on Windows and Linux if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
keyCode | The key code value of the key pressed or released. |
keyLocation | The location of the key on the keyboard. |
shiftKey | true if the Shift key is active; false if it is inactive. |
functionKey | true if the Function key is active (Mac only); false if it is inactive. |
target | The InteractiveObject instance with focus.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event. |
keyUp | event |
flash.events.KeyboardEvent
flash.events.KeyboardEvent.KEY_UP
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched when the user releases a key.
Mappings between keys and specific characters vary by device and operating system. This event type is generated after such a mapping occurs but before the processing of an input method editor (IME). IMEs are used to enter characters that the standard QWERTY keyboard is ill-equipped to produce (for example, Chinese ideographs).
This event occurs after a keyDown
event.
This event is not dispatched for all keys. The keys that cause this event to be dispatched vary by platform.
The KeyboardEvent.KEY_UP
constant defines the value of the type
property of a keyUp
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | true |
cancelable | false ; there is no default behavior to cancel. |
charCode | Contains the character code value of the key pressed or released. |
commandKey | true on Mac if the Command key is active. Otherwise, false |
controlKey | true on Windows and Linux if the Ctrl key is active. true on Mac if either the Control key is active. Otherwise, false |
ctrlKey | true on Windows if the Ctrl key is active. true on Mac if either the Ctrl key or the Command key is active. Otherwise, false . |
currentTarget | The object that is actively processing the Event object with an event listener. |
keyCode | The key code value of the key pressed or released. |
keyLocation | The location of the key on the keyboard. |
shiftKey | true if the Shift key is active; false if it is inactive. |
functionKey | true if the Function key is active (Mac only); false if it is inactive. |
target | The InteractiveObject instance with focus.
The target is not always the object in the display list
that registered the event listener. Use the currentTarget
property to access the object in the display list that is currently processing the event. |
softKeyboardActivate | event |
flash.events.SoftKeyboardEvent
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched after the soft keyboard is activated, as a result of the StageText object acquiring focus.
softKeyboardActivating | event |
flash.events.SoftKeyboardEvent
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched before soft keyboard activation, as a result of the StageText object acquiring focus.
softKeyboardDeactivate | event |
flash.events.SoftKeyboardEvent
Language version: | ActionScript 3.0 |
Runtime version: | AIR 3 |
Dispatched after the soft keyboard is deactivated, as a result of the StageText object losing focus.