857 lines
115 KiB
HTML
857 lines
115 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en"><!-- use theme color or fallback -->
|
|
<!--use textcolor from settings, otherwise create a contrasting color to theme color-->
|
|
<head><meta charset="utf-8"/><link href="../../bootstrap/css/bootstrap.min.css" rel="stylesheet"/><link href="../../bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"/><link href="../../bootstrap/css/bootstrap-select.min.css" rel="stylesheet"/><link href="http://fonts.googleapis.com/css?family=Open+Sans:400,700,700italic,400italic" rel="stylesheet" type="text/css"/><link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,600,600italic,400" rel="stylesheet" type="text/css"/><link href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css" rel="stylesheet" type="text/css"/><script src="../../jquery-1.9.1.min.js"></script><script src="../../bootstrap/js/bootstrap.min.js"></script><script src="../../bootstrap/js/bootstrap-select.min.js"></script><link href="../../styles.css" rel="stylesheet"/><link href="../../haxe-nav.css" rel="stylesheet"/><script type="text/javascript">var dox = {rootPath: "../../",platforms: ["Neko","Android","Flash","iOS","macOS","Linux","HTML5","Windows"]};</script><script type="text/javascript" src="../../nav.js"></script><script type="text/javascript" src="../../index.js"></script><link rel="icon" href="../../favicon.ico" type="image/x-icon"></link><title>openfl.display.FPS - API Reference</title></head><body><style>
|
|
a, code .type {
|
|
color: #24afc4;
|
|
}
|
|
.navbar .brand {
|
|
display: inline-block;
|
|
float: none;
|
|
text-shadow: 0 0 0 transparent;
|
|
}
|
|
.nav-list>.active>a.treeLink, .nav-list>.active>a.treeLink:hover, .nav-list>.active>a.treeLink:focus {
|
|
background: #24afc4;
|
|
color: #ffffff;
|
|
text-shadow: 0 0 0 transparent;
|
|
}
|
|
.navbar .container {
|
|
width: 940px ;
|
|
}
|
|
@media (max-width: 767px) {
|
|
.navbar .container {
|
|
width: auto;
|
|
}
|
|
}
|
|
@media (max-width: 979px) and (min-width: 768px) {
|
|
.navbar .container {
|
|
width: 724px;
|
|
}
|
|
}
|
|
@media (min-width: 1200px) {
|
|
.navbar .container {
|
|
width: 1170px;
|
|
}
|
|
}
|
|
.navbar .container img {
|
|
margin: 5px 0 0 4px;
|
|
}
|
|
</style><nav class="nav"><div class="navbar"><div class="navbar-inner" style="background:#FAFAFA; border-bottom:1px solid rgba(0,0,0,.09)"><div class="container"><a class="brand" href="http://www.openfl.org"><img alt="" src="http://www.openfl.org/images/logo.png"/></a><a class="brand" style="color:#777777" href="../../">API Reference</a></div></div></div></nav><div class="container main-content"><div class="row-fluid"><div class="span3"><div class="well sidebar-nav"><form class="form-search" id="searchForm"><div class="input-prepend input-block-level"><span class="add-on"><i class="icon-search"></i></span><input id="search" type="text" placeholder="Search" autocomplete="off"/></div></form><div class="dropdown"><select id="select-platform" class="selectpicker" title="Filter by platform" data-width="100%"><option value="all" selected="true">All Platforms</option><option>Neko</option><option>Android</option><option>Flash</option><option>iOS</option><option>macOS</option><option>Linux</option><option>HTML5</option><option>Windows</option></select></div></div><div class="well sidebar-nav"><div id="nav"></div></div></div><div class="span9"><div class="page-header"><h1><small>class</small> FPS</h1><h4><small>package <a href="../../openfl/display/index.html">openfl.display</a></small></h4><h4><small>extends <a class="type" title="The TextField class is used to create display objects for text display and input." href="../../openfl/text/TextField.html">TextField</a> › <a class="type" title="The InteractiveObject class is the abstract base class for all display objects with which the user can interact, using the mouse, keyboard, or other user input device." href="../../openfl/display/InteractiveObject.html">InteractiveObject</a> › <a class="type" title="The DisplayObject class is the base class for all objects that can be placed on the display list." href="../../openfl/display/DisplayObject.html">DisplayObject</a> › <a class="type" title="The EventDispatcher class is the base class for all classes that dispatch events." href="../../openfl/events/EventDispatcher.html">EventDispatcher</a></small></h4> <p class="availability"><hr/><em>Available on all platforms</em></p></div><div class="body"><div class="doc doc-main"><div class="indent"><p></p></div></div><h3 class="section">Constructor</h3><div class="fields"><div class="field "><a name="new"></a><h3><p><code><a href="#new"><span class="identifier">new</span></a> (<span style="white-space:nowrap">x:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a> = 10,</span> <span style="white-space:nowrap">y:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a> = 10,</span> <span style="white-space:nowrap">color:<a class="type" title="The standard Int type." href="../../Int.html">Int</a> = 0x000000</span>)</code></p></h3><div class="doc"><p></p></div></div></div><h3 class="section">Variables</h3><div class="fields"><div class="field "><a name="currentFPS"></a><h3><p><code><span class="label">read only</span><a href="../../openfl/display/FPS.html#currentFPS"><span class="identifier">currentFPS</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p></p></div></div></div> <div class="inherited-fields well"><h3 class="section">Inherited Variables</h3><div class="fields"><h4><a href="#" class="expand-button"><i class="fa fa-arrow-circle-o-right"></i></a> Defined by <a class="type" title="The TextField class is used to create display objects for text display and input." href="../../openfl/text/TextField.html">TextField</a></h4><div style="display:none"><div class="field "><a name="antiAliasType"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#antiAliasType"><span class="identifier">antiAliasType</span></a>:<a class="type" title="The AntiAliasType class provides values for anti-aliasing in the flash." href="../../openfl/text/AntiAliasType.html">AntiAliasType</a></code></p></h3><div class="doc"><p>The type of anti-aliasing used for this text field. Use
|
|
<code>flash.text.AntiAliasType</code> constants for this property. You can
|
|
control this setting only if the font is embedded(with the
|
|
<code>embedFonts</code> property set to <code>true</code>). The default
|
|
setting is <code>flash.text.AntiAliasType.NORMAL</code>.</p>
|
|
<p>To set values for this property, use the following string values:</p></div></div><div class="field "><a name="autoSize"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#autoSize"><span class="identifier">autoSize</span></a>:<a class="type" title="The TextFieldAutoSize class is an enumeration of constant values used in setting the autoSize property of the TextField class." href="../../openfl/text/TextFieldAutoSize.html">TextFieldAutoSize</a></code></p></h3><div class="doc"><p>Controls automatic sizing and alignment of text fields. Acceptable values
|
|
for the <code><a href="../../openfl/text/TextFieldAutoSize.html">TextFieldAutoSize</a></code> constants:
|
|
<code>TextFieldAutoSize.NONE</code>(the default),
|
|
<code>TextFieldAutoSize.LEFT</code>, <code>TextFieldAutoSize.RIGHT</code>,
|
|
and <code>TextFieldAutoSize.CENTER</code>.</p>
|
|
<p>If <code>autoSize</code> is set to <code>TextFieldAutoSize.NONE</code>
|
|
(the default) no resizing occurs.</p>
|
|
<p>If <code>autoSize</code> is set to <code>TextFieldAutoSize.LEFT</code>,
|
|
the text is treated as left-justified text, meaning that the left margin
|
|
of the text field remains fixed and any resizing of a single line of the
|
|
text field is on the right margin. If the text includes a line break(for
|
|
example, <code>"\n"</code> or <code>"\r"</code>), the bottom is also
|
|
resized to fit the next line of text. If <code>wordWrap</code> is also set
|
|
to <code>true</code>, only the bottom of the text field is resized and the
|
|
right side remains fixed.</p>
|
|
<p>If <code>autoSize</code> is set to
|
|
<code>TextFieldAutoSize.RIGHT</code>, the text is treated as
|
|
right-justified text, meaning that the right margin of the text field
|
|
remains fixed and any resizing of a single line of the text field is on
|
|
the left margin. If the text includes a line break(for example,
|
|
<code>"\n" or "\r")</code>, the bottom is also resized to fit the next
|
|
line of text. If <code>wordWrap</code> is also set to <code>true</code>,
|
|
only the bottom of the text field is resized and the left side remains
|
|
fixed.</p>
|
|
<p>If <code>autoSize</code> is set to
|
|
<code>TextFieldAutoSize.CENTER</code>, the text is treated as
|
|
center-justified text, meaning that any resizing of a single line of the
|
|
text field is equally distributed to both the right and left margins. If
|
|
the text includes a line break(for example, <code>"\n"</code> or
|
|
<code>"\r"</code>), the bottom is also resized to fit the next line of
|
|
text. If <code>wordWrap</code> is also set to <code>true</code>, only the
|
|
bottom of the text field is resized and the left and right sides remain
|
|
fixed.</p><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>ArgumentError</code></th><td><p>The <code>autoSize</code> specified is not a member
|
|
of flash.text.TextFieldAutoSize.</p></td></tr></div></table></div></div><div class="field "><a name="background"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#background"><span class="identifier">background</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Specifies whether the text field has a background fill. If
|
|
<code>true</code>, the text field has a background fill. If
|
|
<code>false</code>, the text field has no background fill. Use the
|
|
<code>backgroundColor</code> property to set the background color of a
|
|
text field.</p></div></div><div class="field "><a name="backgroundColor"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#backgroundColor"><span class="identifier">backgroundColor</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The color of the text field background. The default value is
|
|
<code>0xFFFFFF</code>(white). This property can be retrieved or set, even
|
|
if there currently is no background, but the color is visible only if the
|
|
text field has the <code>background</code> property set to
|
|
<code>true</code>.</p></div></div><div class="field "><a name="border"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#border"><span class="identifier">border</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Specifies whether the text field has a border. If <code>true</code>, the
|
|
text field has a border. If <code>false</code>, the text field has no
|
|
border. Use the <code>borderColor</code> property to set the border color.</p></div></div><div class="field "><a name="borderColor"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#borderColor"><span class="identifier">borderColor</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The color of the text field border. The default value is
|
|
<code>0x000000</code>(black). This property can be retrieved or set, even
|
|
if there currently is no border, but the color is visible only if the text
|
|
field has the <code>border</code> property set to <code>true</code>.</p></div></div><div class="field "><a name="bottomScrollV"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#bottomScrollV"><span class="identifier">bottomScrollV</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>An integer(1-based index) that indicates the bottommost line that is
|
|
currently visible in the specified text field. Think of the text field as
|
|
a window onto a block of text. The <code>scrollV</code> property is the
|
|
1-based index of the topmost visible line in the window.</p>
|
|
<p>All the text between the lines indicated by <code>scrollV</code> and
|
|
<code>bottomScrollV</code> is currently visible in the text field.</p></div></div><div class="field "><a name="caretIndex"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#caretIndex"><span class="identifier">caretIndex</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The index of the insertion point(caret) position. If no insertion point
|
|
is displayed, the value is the position the insertion point would be if
|
|
you restored focus to the field(typically where the insertion point last
|
|
was, or 0 if the field has not had focus).</p>
|
|
<p>Selection span indexes are zero-based(for example, the first position
|
|
is 0, the second position is 1, and so on).</p></div></div><div class="field "><a name="defaultTextFormat"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#defaultTextFormat"><span class="identifier">defaultTextFormat</span></a>:<a class="type" title="The TextFormat class represents character formatting information." href="../../openfl/text/TextFormat.html">TextFormat</a></code></p></h3><div class="doc"><p>Specifies the format applied to newly inserted text, such as text entered
|
|
by a user or text inserted with the <code>replaceSelectedText()</code>
|
|
method.</p>
|
|
<p><strong>Note:</strong> When selecting characters to be replaced with
|
|
<code>setSelection()</code> and <code>replaceSelectedText()</code>, the
|
|
<code>defaultTextFormat</code> will be applied only if the text has been
|
|
selected up to and including the last character. Here is an example:</p>
|
|
<pre><code>var my_txt:TextField new TextField();
|
|
my_txt.text = "Flash Macintosh version"; var my_fmt:TextFormat = new
|
|
TextFormat(); my_fmt.color = 0xFF0000; my_txt.defaultTextFormat = my_fmt;
|
|
my_txt.setSelection(6,15); // partial text selected - defaultTextFormat
|
|
not applied my_txt.setSelection(6,23); // text selected to end -
|
|
defaultTextFormat applied my_txt.replaceSelectedText("Windows version");</code></pre>
|
|
<p>When you access the <code>defaultTextFormat</code> property, the
|
|
returned TextFormat object has all of its properties defined. No property
|
|
is <code>null</code>.</p>
|
|
<p><strong>Note:</strong> You can't set this property if a style sheet is applied to
|
|
the text field.</p><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>Error</code></th><td><p>This method cannot be used on a text field with a style
|
|
sheet.</p></td></tr></div></table></div></div><div class="field "><a name="displayAsPassword"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#displayAsPassword"><span class="identifier">displayAsPassword</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Specifies whether the text field is a password text field. If the value of
|
|
this property is <code>true</code>, the text field is treated as a
|
|
password text field and hides the input characters using asterisks instead
|
|
of the actual characters. If <code>false</code>, the text field is not
|
|
treated as a password text field. When password mode is enabled, the Cut
|
|
and Copy commands and their corresponding keyboard shortcuts will not
|
|
function. This security mechanism prevents an unscrupulous user from using
|
|
the shortcuts to discover a password on an unattended computer.</p></div></div><div class="field "><a name="embedFonts"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#embedFonts"><span class="identifier">embedFonts</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Specifies whether to render by using embedded font outlines. If
|
|
<code>false</code>, Flash Player renders the text field by using device
|
|
fonts.</p>
|
|
<p>If you set the <code>embedFonts</code> property to <code>true</code>
|
|
for a text field, you must specify a font for that text by using the
|
|
<code>font</code> property of a TextFormat object applied to the text
|
|
field. If the specified font is not embedded in the SWF file, the text is
|
|
not displayed.</p></div></div><div class="field "><a name="gridFitType"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#gridFitType"><span class="identifier">gridFitType</span></a>:<a class="type" title="" href="../../openfl/text/GridFitType.html">GridFitType</a></code></p></h3><div class="doc"><p>The type of grid fitting used for this text field. This property applies
|
|
only if the <code>flash.text.AntiAliasType</code> property of the text
|
|
field is set to <code>flash.text.AntiAliasType.ADVANCED</code>.</p>
|
|
<p>The type of grid fitting used determines whether Flash Player forces
|
|
strong horizontal and vertical lines to fit to a pixel or subpixel grid,
|
|
or not at all.</p>
|
|
<p>For the <code>flash.text.GridFitType</code> property, you can use the
|
|
following string values:</p></div></div><div class="field "><a name="htmlText"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#htmlText"><span class="identifier">htmlText</span></a>:<a class="type" title="The basic String class." href="../../String.html">String</a></code></p></h3><div class="doc"><p>Contains the HTML representation of the text field contents.</p>
|
|
<p>Flash Player supports the following HTML tags:</p>
|
|
<p>Flash Player and AIR also support explicit character codes, such as
|
|
&(ASCII ampersand) and €(Unicode € symbol).</p></div></div><div class="field "><a name="length"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#length"><span class="identifier">length</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The number of characters in a text field. A character such as tab
|
|
(<code>\t</code>) counts as one character.</p></div></div><div class="field "><a name="maxChars"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#maxChars"><span class="identifier">maxChars</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The maximum number of characters that the text field can contain, as
|
|
entered by a user. A script can insert more text than
|
|
<code>maxChars</code> allows; the <code>maxChars</code> property indicates
|
|
only how much text a user can enter. If the value of this property is
|
|
<code>0</code>, a user can enter an unlimited amount of text.</p></div></div><div class="field "><a name="maxScrollH"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#maxScrollH"><span class="identifier">maxScrollH</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The maximum value of <code>scrollH</code>.</p></div></div><div class="field "><a name="maxScrollV"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#maxScrollV"><span class="identifier">maxScrollV</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The maximum value of <code>scrollV</code>.</p></div></div><div class="field "><a name="mouseWheelEnabled"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#mouseWheelEnabled"><span class="identifier">mouseWheelEnabled</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="multiline"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#multiline"><span class="identifier">multiline</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Indicates whether field is a multiline text field. If the value is
|
|
<code>true</code>, the text field is multiline; if the value is
|
|
<code>false</code>, the text field is a single-line text field. In a field
|
|
of type <code>TextFieldType.INPUT</code>, the <code>multiline</code> value
|
|
determines whether the <code>Enter</code> key creates a new line(a value
|
|
of <code>false</code>, and the <code>Enter</code> key is ignored). If you
|
|
paste text into a <code><a href="../../openfl/text/TextField.html">TextField</a></code> with a <code>multiline</code>
|
|
value of <code>false</code>, newlines are stripped out of the text.</p></div></div><div class="field "><a name="numLines"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#numLines"><span class="identifier">numLines</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>Defines the number of text lines in a multiline text field. If
|
|
<code>wordWrap</code> property is set to <code>true</code>, the number of
|
|
lines increases when text wraps.</p></div></div><div class="field "><a name="restrict"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#restrict"><span class="identifier">restrict</span></a>:<a class="type" title="The basic String class." href="../../String.html">String</a></code></p></h3><div class="doc"><p>Indicates the set of characters that a user can enter into the text field.
|
|
If the value of the <code>restrict</code> property is <code>null</code>,
|
|
you can enter any character. If the value of the <code>restrict</code>
|
|
property is an empty string, you cannot enter any character. If the value
|
|
of the <code>restrict</code> property is a string of characters, you can
|
|
enter only characters in the string into the text field. The string is
|
|
scanned from left to right. You can specify a range by using the hyphen
|
|
(-) character. Only user interaction is restricted; a script can put any
|
|
text into the text field. <ph outputclass="flashonly">This property does
|
|
not synchronize with the Embed font options in the Property inspector.</p>
|
|
<p>If the string begins with a caret(^) character, all characters are
|
|
initially accepted and succeeding characters in the string are excluded
|
|
from the set of accepted characters. If the string does not begin with a
|
|
caret(^) character, no characters are initially accepted and succeeding
|
|
characters in the string are included in the set of accepted
|
|
characters.</p>
|
|
<p>The following example allows only uppercase characters, spaces, and
|
|
numbers to be entered into a text field:
|
|
<code>my_txt.restrict = "A-Z 0-9";</code></p>
|
|
<p>The following example includes all characters, but excludes lowercase
|
|
letters:
|
|
<code>my_txt.restrict = "^a-z";</code></p>
|
|
<p>You can use a backslash to enter a ^ or - verbatim. The accepted
|
|
backslash sequences are -, \^ or . The backslash must be an actual
|
|
character in the string, so when specified in ActionScript, a double
|
|
backslash must be used. For example, the following code includes only the
|
|
dash(-) and caret(^):
|
|
<code>my_txt.restrict = "\\-\\^";</code></p>
|
|
<p>The ^ can be used anywhere in the string to toggle between including
|
|
characters and excluding characters. The following code includes only
|
|
uppercase letters, but excludes the uppercase letter Q:
|
|
<code>my_txt.restrict = "A-Z^Q";</code></p>
|
|
<p>You can use the <code>\u</code> escape sequence to construct
|
|
<code>restrict</code> strings. The following code includes only the
|
|
characters from ASCII 32(space) to ASCII 126(tilde).
|
|
<code>my_txt.restrict = "\u0020-\u007E";</code></p></div></div><div class="field "><a name="scrollH"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#scrollH"><span class="identifier">scrollH</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The current horizontal scrolling position. If the <code>scrollH</code>
|
|
property is 0, the text is not horizontally scrolled. This property value
|
|
is an integer that represents the horizontal position in pixels.</p>
|
|
<p>The units of horizontal scrolling are pixels, whereas the units of
|
|
vertical scrolling are lines. Horizontal scrolling is measured in pixels
|
|
because most fonts you typically use are proportionally spaced; that is,
|
|
the characters can have different widths. Flash Player performs vertical
|
|
scrolling by line because users usually want to see a complete line of
|
|
text rather than a partial line. Even if a line uses multiple fonts, the
|
|
height of the line adjusts to fit the largest font in use.</p>
|
|
<p><strong>Note: </strong>The <code>scrollH</code> property is zero-based, not
|
|
1-based like the <code>scrollV</code> vertical scrolling property.</p></div></div><div class="field "><a name="scrollV"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#scrollV"><span class="identifier">scrollV</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The vertical position of text in a text field. The <code>scrollV</code>
|
|
property is useful for directing users to a specific paragraph in a long
|
|
passage, or creating scrolling text fields.</p>
|
|
<p>The units of vertical scrolling are lines, whereas the units of
|
|
horizontal scrolling are pixels. If the first line displayed is the first
|
|
line in the text field, scrollV is set to 1(not 0). Horizontal scrolling
|
|
is measured in pixels because most fonts are proportionally spaced; that
|
|
is, the characters can have different widths. Flash performs vertical
|
|
scrolling by line because users usually want to see a complete line of
|
|
text rather than a partial line. Even if there are multiple fonts on a
|
|
line, the height of the line adjusts to fit the largest font in use.</p></div></div><div class="field "><a name="selectable"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#selectable"><span class="identifier">selectable</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>A Boolean value that indicates whether the text field is selectable. The
|
|
value <code>true</code> indicates that the text is selectable. The
|
|
<code>selectable</code> property controls whether a text field is
|
|
selectable, not whether a text field is editable. A dynamic text field can
|
|
be selectable even if it is not editable. If a dynamic text field is not
|
|
selectable, the user cannot select its text.</p>
|
|
<p>If <code>selectable</code> is set to <code>false</code>, the text in
|
|
the text field does not respond to selection commands from the mouse or
|
|
keyboard, and the text cannot be copied with the Copy command. If
|
|
<code>selectable</code> is set to <code>true</code>, the text in the text
|
|
field can be selected with the mouse or keyboard, and the text can be
|
|
copied with the Copy command. You can select text this way even if the
|
|
text field is a dynamic text field instead of an input text field. </p></div></div><div class="field "><a name="selectionBeginIndex"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#selectionBeginIndex"><span class="identifier">selectionBeginIndex</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>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 property is the value of
|
|
<code>caretIndex</code>.</p></div></div><div class="field "><a name="selectionEndIndex"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#selectionEndIndex"><span class="identifier">selectionEndIndex</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>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 property is the value of
|
|
<code>caretIndex</code>.</p></div></div><div class="field "><a name="sharpness"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#sharpness"><span class="identifier">sharpness</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>The sharpness of the glyph edges in this text field. This property applies
|
|
only if the <code>flash.text.AntiAliasType</code> property of the text
|
|
field is set to <code>flash.text.AntiAliasType.ADVANCED</code>. The range
|
|
for <code>sharpness</code> is a number from -400 to 400. If you attempt to
|
|
set <code>sharpness</code> to a value outside that range, Flash sets the
|
|
property to the nearest value in the range(either -400 or 400).</p></div></div><div class="field "><a name="text"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#text"><span class="identifier">text</span></a>:<a class="type" title="The basic String class." href="../../String.html">String</a></code></p></h3><div class="doc"><p>A string that is the current text in the text field. Lines are separated
|
|
by the carriage return character(<code>'\r'</code>, ASCII 13). This
|
|
property contains unformatted text in the text field, without HTML tags.</p>
|
|
<p>To get the text in HTML form, use the <code>htmlText</code>
|
|
property.</p></div></div><div class="field "><a name="textColor"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#textColor"><span class="identifier">textColor</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>The color of the text in a text field, in hexadecimal format. The
|
|
hexadecimal color system uses six digits to represent color values. Each
|
|
digit has 16 possible values or characters. The characters range from 0-9
|
|
and then A-F. For example, black is <code>0x000000</code>; white is
|
|
<code>0xFFFFFF</code>.</p></div></div><div class="field "><a name="textHeight"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#textHeight"><span class="identifier">textHeight</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>The height of the text in pixels.</p></div></div><div class="field "><a name="textWidth"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#textWidth"><span class="identifier">textWidth</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>The width of the text in pixels.</p></div></div><div class="field "><a name="type"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#type"><span class="identifier">type</span></a>:<a class="type" title="The TextFieldType class is an enumeration of constant values used in setting the type property of the TextField class." href="../../openfl/text/TextFieldType.html">TextFieldType</a></code></p></h3><div class="doc"><p>The type of the text field. Either one of the following TextFieldType
|
|
constants: <code>TextFieldType.DYNAMIC</code>, which specifies a dynamic
|
|
text field, which a user cannot edit, or <code>TextFieldType.INPUT</code>,
|
|
which specifies an input text field, which a user can edit.</p><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>ArgumentError</code></th><td><p>The <code>type</code> specified is not a member of
|
|
flash.text.TextFieldType.</p></td></tr></div></table></div></div><div class="field "><a name="wordWrap"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/text/TextField.html#wordWrap"><span class="identifier">wordWrap</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>A Boolean value that indicates whether the text field has word wrap. If
|
|
the value of <code>wordWrap</code> is <code>true</code>, the text field
|
|
has word wrap; if the value is <code>false</code>, the text field does not
|
|
have word wrap. The default value is <code>false</code>.</p></div></div></div><h4><a href="#" class="expand-button"><i class="fa fa-arrow-circle-o-right"></i></a> Defined by <a class="type" title="The InteractiveObject class is the abstract base class for all display objects with which the user can interact, using the mouse, keyboard, or other user input device." href="../../openfl/display/InteractiveObject.html">InteractiveObject</a></h4><div style="display:none"><div class="field "><a name="doubleClickEnabled"></a><h3><p><code><a href="../../openfl/display/InteractiveObject.html#doubleClickEnabled"><span class="identifier">doubleClickEnabled</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Specifies whether the object receives <code>doubleClick</code> events. The
|
|
default value is <code>false</code>, which means that by default an
|
|
InteractiveObject instance does not receive <code>doubleClick</code>
|
|
events. If the <code>doubleClickEnabled</code> property is set to
|
|
<code>true</code>, the instance receives <code>doubleClick</code> events
|
|
within its bounds. The <code>mouseEnabled</code> property of the
|
|
InteractiveObject instance must also be set to <code>true</code> for the
|
|
object to receive <code>doubleClick</code> events.</p>
|
|
<p>No event is dispatched by setting this property. You must use the
|
|
<code>addEventListener()</code> method to add an event listener for the
|
|
<code>doubleClick</code> event.</p></div></div><div class="field "><a name="focusRect"></a><h3><p><code><a href="../../openfl/display/InteractiveObject.html#focusRect"><span class="identifier">focusRect</span></a>:<a class="type" title="Null can be useful in two cases." href="../../Null.html">Null</a><<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a>></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="mouseEnabled"></a><h3><p><code><a href="../../openfl/display/InteractiveObject.html#mouseEnabled"><span class="identifier">mouseEnabled</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Specifies whether this object receives mouse, or other user input,
|
|
messages. The default value is <code>true</code>, which means that by
|
|
default any InteractiveObject instance that is on the display list
|
|
receives mouse events or other user input events. If
|
|
<code>mouseEnabled</code> is set to <code>false</code>, the instance does
|
|
not receive any mouse events(or other user input events like keyboard
|
|
events). Any children of this instance on the display list are not
|
|
affected. To change the <code>mouseEnabled</code> behavior for all
|
|
children of an object on the display list, use
|
|
<code><a href="../../openfl/display/DisplayObjectContainer.html#mouseChildren">openfl.display.DisplayObjectContainer.mouseChildren</a></code>.</p>
|
|
<p>No event is dispatched by setting this property. You must use the
|
|
<code>addEventListener()</code> method to create interactive
|
|
functionality.</p></div></div><div class="field "><a name="needsSoftKeyboard"></a><h3><p><code><a href="../../openfl/display/InteractiveObject.html#needsSoftKeyboard"><span class="identifier">needsSoftKeyboard</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Specifies whether a virtual keyboard(an on-screen, software keyboard)
|
|
should display when this InteractiveObject instance receives focus.</p>
|
|
<p>By default, the value is <code>false</code> and focusing an
|
|
InteractiveObject instance does not raise a soft keyboard. If the
|
|
<code>needsSoftKeyboard</code> property is set to <code>true</code>, the
|
|
runtime raises a soft keyboard when the InteractiveObject instance is
|
|
ready to accept user input. An InteractiveObject instance is ready to
|
|
accept user input after a programmatic call to set the Stage
|
|
<code>focus</code> property or a user interaction, such as a "tap." If the
|
|
client system has a hardware keyboard available or does not support
|
|
virtual keyboards, then the soft keyboard is not raised.</p>
|
|
<p>The InteractiveObject instance dispatches
|
|
<code>softKeyboardActivating</code>, <code>softKeyboardActivate</code>,
|
|
and <code>softKeyboardDeactivate</code> events when the soft keyboard
|
|
raises and lowers.</p>
|
|
<p><strong>Note:</strong> This property is not supported in AIR applications on
|
|
iOS.</p></div></div><div class="field "><a name="softKeyboardInputAreaOfInterest"></a><h3><p><code><a href="../../openfl/display/InteractiveObject.html#softKeyboardInputAreaOfInterest"><span class="identifier">softKeyboardInputAreaOfInterest</span></a>:<a class="type" title="A Rectangle object is an area defined by its position, as indicated by its top-left corner point(x, y) and by its width and its height." href="../../openfl/geom/Rectangle.html">Rectangle</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="tabEnabled"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/InteractiveObject.html#tabEnabled"><span class="identifier">tabEnabled</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="tabIndex"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/InteractiveObject.html#tabIndex"><span class="identifier">tabIndex</span></a>:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p></p></div></div></div><h4><a href="#" class="expand-button"><i class="fa fa-arrow-circle-o-right"></i></a> Defined by <a class="type" title="The DisplayObject class is the base class for all objects that can be placed on the display list." href="../../openfl/display/DisplayObject.html">DisplayObject</a></h4><div style="display:none"><div class="field "><a name="alpha"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#alpha"><span class="identifier">alpha</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the alpha transparency value of the object specified. Valid
|
|
values are 0(fully transparent) to 1(fully opaque). The default value is
|
|
1. Display objects with <code>alpha</code> set to 0 <em>are</em> active,
|
|
even though they are invisible.</p></div></div><div class="field "><a name="blendMode"></a><h3><p><code><span class="label">read only</span><a href="../../openfl/display/DisplayObject.html#blendMode"><span class="identifier">blendMode</span></a>:<a class="type" title="A class that provides constant values for visual blend mode effects." href="../../openfl/display/BlendMode.html">BlendMode</a></code></p></h3><div class="doc"><p>A value from the BlendMode class that specifies which blend mode to use. A
|
|
bitmap can be drawn internally in two ways. If you have a blend mode
|
|
enabled or an external clipping mask, the bitmap is drawn by adding a
|
|
bitmap-filled square shape to the vector render. If you attempt to set
|
|
this property to an invalid value, Flash runtimes set the value to
|
|
<code>BlendMode.NORMAL</code>.</p>
|
|
<p>The <code>blendMode</code> property affects each pixel of the display
|
|
object. Each pixel is composed of three constituent colors(red, green,
|
|
and blue), and each constituent color has a value between 0x00 and 0xFF.
|
|
Flash Player or Adobe AIR compares each constituent color of one pixel in
|
|
the movie clip with the corresponding color of the pixel in the
|
|
background. For example, if <code>blendMode</code> is set to
|
|
<code>BlendMode.LIGHTEN</code>, Flash Player or Adobe AIR compares the red
|
|
value of the display object with the red value of the background, and uses
|
|
the lighter of the two as the value for the red component of the displayed
|
|
color.</p>
|
|
<p>The following table describes the <code>blendMode</code> settings. The
|
|
BlendMode class defines string values you can use. The illustrations in
|
|
the table show <code>blendMode</code> values applied to a circular display
|
|
object(2) superimposed on another display object(1).</p></div></div><div class="field "><a name="cacheAsBitmap"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#cacheAsBitmap"><span class="identifier">cacheAsBitmap</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>All vector data for a display object that has a cached bitmap is drawn
|
|
to the bitmap instead of the main display. If
|
|
<code>cacheAsBitmapMatrix</code> is null or unsupported, the bitmap is
|
|
then copied to the main display as unstretched, unrotated pixels snapped
|
|
to the nearest pixel boundaries. Pixels are mapped 1 to 1 with the parent
|
|
object. If the bounds of the bitmap change, the bitmap is recreated
|
|
instead of being stretched.</p>
|
|
<p>If <code>cacheAsBitmapMatrix</code> is non-null and supported, the
|
|
object is drawn to the off-screen bitmap using that matrix and the
|
|
stretched and/or rotated results of that rendering are used to draw the
|
|
object to the main display.</p>
|
|
<p>No internal bitmap is created unless the <code>cacheAsBitmap</code>
|
|
property is set to <code>true</code>.</p>
|
|
<p>After you set the <code>cacheAsBitmap</code> property to
|
|
<code>true</code>, the rendering does not change, however the display
|
|
object performs pixel snapping automatically. The animation speed can be
|
|
significantly faster depending on the complexity of the vector content.</p>
|
|
<p>The <code>cacheAsBitmap</code> property is automatically set to
|
|
<code>true</code> whenever you apply a filter to a display object(when
|
|
its <code>filter</code> array is not empty), and if a display object has a
|
|
filter applied to it, <code>cacheAsBitmap</code> is reported as
|
|
<code>true</code> for that display object, even if you set the property to
|
|
<code>false</code>. If you clear all filters for a display object, the
|
|
<code>cacheAsBitmap</code> setting changes to what it was last set to.</p>
|
|
<p>A display object does not use a bitmap even if the
|
|
<code>cacheAsBitmap</code> property is set to <code>true</code> and
|
|
instead renders from vector data in the following cases:</p><ul><li>The bitmap is too large. In AIR 1.5 and Flash Player 10, the maximum
|
|
size for a bitmap image is 8,191 pixels in width or height, and the total
|
|
number of pixels cannot exceed 16,777,215 pixels.(So, if a bitmap image
|
|
is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9
|
|
and earlier, the limitation is is 2880 pixels in height and 2,880 pixels
|
|
in width.</li><li>The bitmap fails to allocate(out of memory error). </li></ul>
|
|
<p>The <code>cacheAsBitmap</code> property is best used with movie clips
|
|
that have mostly static content and that do not scale and rotate
|
|
frequently. With such movie clips, <code>cacheAsBitmap</code> can lead to
|
|
performance increases when the movie clip is translated(when its <em>x</em>
|
|
and <em>y</em> position is changed).</p></div></div><div class="field "><a name="filters"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#filters"><span class="identifier">filters</span></a>:<a class="type" title="An Array is a storage for values." href="../../Array.html">Array</a><<a class="type" title="The BitmapFilter class is the base class for all image filter effects." href="../../openfl/filters/BitmapFilter.html">BitmapFilter</a>></code></p></h3><div class="doc"><p>An indexed array that contains each filter object currently associated
|
|
with the display object. The openfl.filters package contains several
|
|
classes that define specific filters you can use.</p>
|
|
<p>Filters can be applied in Flash Professional at design time, or at run
|
|
time by using ActionScript code. To apply a filter by using ActionScript,
|
|
you must make a temporary copy of the entire <code>filters</code> array,
|
|
modify the temporary array, then assign the value of the temporary array
|
|
back to the <code>filters</code> array. You cannot directly add a new
|
|
filter object to the <code>filters</code> array.</p>
|
|
<p>To add a filter by using ActionScript, perform the following steps
|
|
(assume that the target display object is named
|
|
<code>myDisplayObject</code>):</p><ol><li>Create a new filter object by using the constructor method of your
|
|
chosen filter class.</li><li>Assign the value of the <code>myDisplayObject.filters</code> array
|
|
to a temporary array, such as one named <code>myFilters</code>.</li><li>Add the new filter object to the <code>myFilters</code> temporary
|
|
array.</li><li>Assign the value of the temporary array to the
|
|
<code>myDisplayObject.filters</code> array.</li></ol>
|
|
<p>If the <code>filters</code> array is undefined, you do not need to use
|
|
a temporary array. Instead, you can directly assign an array literal that
|
|
contains one or more filter objects that you create. The first example in
|
|
the Examples section adds a drop shadow filter by using code that handles
|
|
both defined and undefined <code>filters</code> arrays.</p>
|
|
<p>To modify an existing filter object, you must use the technique of
|
|
modifying a copy of the <code>filters</code> array:</p><ol><li>Assign the value of the <code>filters</code> array to a temporary
|
|
array, such as one named <code>myFilters</code>.</li><li>Modify the property by using the temporary array,
|
|
<code>myFilters</code>. For example, to set the quality property of the
|
|
first filter in the array, you could use the following code:
|
|
<code>myFilters[0].quality = 1;</code></li><li>Assign the value of the temporary array to the <code>filters</code>
|
|
array.</li></ol>
|
|
<p>At load time, if a display object has an associated filter, it is
|
|
marked to cache itself as a transparent bitmap. From this point forward,
|
|
as long as the display object has a valid filter list, the player caches
|
|
the display object as a bitmap. This source bitmap is used as a source
|
|
image for the filter effects. Each display object usually has two bitmaps:
|
|
one with the original unfiltered source display object and another for the
|
|
final image after filtering. The final image is used when rendering. As
|
|
long as the display object does not change, the final image does not need
|
|
updating.</p>
|
|
<p>The openfl.filters package includes classes for filters. For example, to
|
|
create a DropShadow filter, you would write:</p><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>ArgumentError</code></th><td><p>When <code>filters</code> includes a ShaderFilter
|
|
and the shader output type is not compatible with
|
|
this operation(the shader must specify a
|
|
<code>pixel4</code> output).</p></td></tr></div><div class="indent inline-content"><tr><th width="25%"><code>ArgumentError</code></th><td><p>When <code>filters</code> includes a ShaderFilter
|
|
and the shader doesn't specify any image input or
|
|
the first input is not an <code>image4</code> input.</p></td></tr></div><div class="indent inline-content"><tr><th width="25%"><code>ArgumentError</code></th><td><p>When <code>filters</code> includes a ShaderFilter
|
|
and the shader specifies an image input that isn't
|
|
provided.</p></td></tr></div><div class="indent inline-content"><tr><th width="25%"><code>ArgumentError</code></th><td><p>When <code>filters</code> includes a ShaderFilter, a
|
|
ByteArray or Vector.<Number> instance as a shader
|
|
input, and the <code>width</code> and
|
|
<code>height</code> properties aren't specified for
|
|
the ShaderInput object, or the specified values
|
|
don't match the amount of data in the input data.
|
|
See the <code><a href="../../openfl/display/ShaderInput.html#input">ShaderInput.input</a></code> property for
|
|
more information.</p></td></tr></div></table></div></div><div class="field "><a name="height"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#height"><span class="identifier">height</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the height of the display object, in pixels. The height is
|
|
calculated based on the bounds of the content of the display object. When
|
|
you set the <code>height</code> property, the <code>scaleY</code> property
|
|
is adjusted accordingly, as shown in the following code:</p>
|
|
<p>Except for TextField and Video objects, a display object with no
|
|
content(such as an empty sprite) has a height of 0, even if you try to
|
|
set <code>height</code> to a different value.</p></div></div><div class="field "><a name="loaderInfo"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#loaderInfo"><span class="identifier">loaderInfo</span></a>:<a class="type" title="The LoaderInfo class provides information about a loaded SWF file or a loaded image file(JPEG, GIF, or PNG)." href="../../openfl/display/LoaderInfo.html">LoaderInfo</a></code></p></h3><div class="doc"><p>Returns a LoaderInfo object containing information about loading the file
|
|
to which this display object belongs. The <code>loaderInfo</code> property
|
|
is defined only for the root display object of a SWF file or for a loaded
|
|
Bitmap(not for a Bitmap that is drawn with ActionScript). To find the
|
|
<code>loaderInfo</code> object associated with the SWF file that contains
|
|
a display object named <code>myDisplayObject</code>, use
|
|
<code>myDisplayObject.root.loaderInfo</code>.</p>
|
|
<p>A large SWF file can monitor its download by calling
|
|
<code>this.<a href="#root">root</a>.loaderInfo.addEventListener(Event.COMPLETE,
|
|
func)</code>.</p></div></div><div class="field "><a name="mask"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#mask"><span class="identifier">mask</span></a>:<a class="type" title="The DisplayObject class is the base class for all objects that can be placed on the display list." href="../../openfl/display/DisplayObject.html">DisplayObject</a></code></p></h3><div class="doc"><p>The calling display object is masked by the specified <code>mask</code>
|
|
object. To ensure that masking works when the Stage is scaled, the
|
|
<code>mask</code> display object must be in an active part of the display
|
|
list. The <code>mask</code> object itself is not drawn. Set
|
|
<code>mask</code> to <code>null</code> to remove the mask.</p>
|
|
<p>To be able to scale a mask object, it must be on the display list. To
|
|
be able to drag a mask Sprite object(by calling its
|
|
<code>startDrag()</code> method), it must be on the display list. To call
|
|
the <code>startDrag()</code> method for a mask sprite based on a
|
|
<code>mouseDown</code> event being dispatched by the sprite, set the
|
|
sprite's <code>buttonMode</code> property to <code>true</code>.</p>
|
|
<p>When display objects are cached by setting the
|
|
<code>cacheAsBitmap</code> property to <code>true</code> an the
|
|
<code>cacheAsBitmapMatrix</code> property to a Matrix object, both the
|
|
mask and the display object being masked must be part of the same cached
|
|
bitmap. Thus, if the display object is cached, then the mask must be a
|
|
child of the display object. If an ancestor of the display object on the
|
|
display list is cached, then the mask must be a child of that ancestor or
|
|
one of its descendents. If more than one ancestor of the masked object is
|
|
cached, then the mask must be a descendent of the cached container closest
|
|
to the masked object in the display list.</p>
|
|
<p><strong>Note:</strong> A single <code>mask</code> object cannot be used to mask
|
|
more than one calling display object. When the <code>mask</code> is
|
|
assigned to a second display object, it is removed as the mask of the
|
|
first object, and that object's <code>mask</code> property becomes
|
|
<code>null</code>.</p></div></div><div class="field "><a name="mouseX"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#mouseX"><span class="identifier">mouseX</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the x coordinate of the mouse or user input device position, in
|
|
pixels.</p>
|
|
<p><strong>Note</strong>: For a DisplayObject that has been rotated, the returned x
|
|
coordinate will reflect the non-rotated object.</p></div></div><div class="field "><a name="mouseY"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#mouseY"><span class="identifier">mouseY</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the y coordinate of the mouse or user input device position, in
|
|
pixels.</p>
|
|
<p><strong>Note</strong>: For a DisplayObject that has been rotated, the returned y
|
|
coordinate will reflect the non-rotated object.</p></div></div><div class="field "><a name="name"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#name"><span class="identifier">name</span></a>:<a class="type" title="The basic String class." href="../../String.html">String</a></code></p></h3><div class="doc"><p>Indicates the instance name of the DisplayObject. The object can be
|
|
identified in the child list of its parent display object container by
|
|
calling the <code>getChildByName()</code> method of the display object
|
|
container.</p><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>IllegalOperationError</code></th><td><p>If you are attempting to set this property
|
|
on an object that was placed on the timeline
|
|
in the Flash authoring tool.</p></td></tr></div></table></div></div><div class="field "><a name="opaqueBackground"></a><h3><p><code><a href="../../openfl/display/DisplayObject.html#opaqueBackground"><span class="identifier">opaqueBackground</span></a>:<a class="type" title="Null can be useful in two cases." href="../../Null.html">Null</a><<a class="type" title="The unsigned Int type is only defined for Flash and C#." href="../../UInt.html">UInt</a>></code></p></h3><div class="doc"><p>Specifies whether the display object is opaque with a certain background
|
|
color. A transparent bitmap contains alpha channel data and is drawn
|
|
transparently. An opaque bitmap has no alpha channel(and renders faster
|
|
than a transparent bitmap). If the bitmap is opaque, you specify its own
|
|
background color to use.</p>
|
|
<p>If set to a number value, the surface is opaque(not transparent) with
|
|
the RGB background color that the number specifies. If set to
|
|
<code>null</code>(the default value), the display object has a
|
|
transparent background.</p>
|
|
<p>The <code>opaqueBackground</code> property is intended mainly for use
|
|
with the <code>cacheAsBitmap</code> property, for rendering optimization.
|
|
For display objects in which the <code>cacheAsBitmap</code> property is
|
|
set to true, setting <code>opaqueBackground</code> can improve rendering
|
|
performance.</p>
|
|
<p>The opaque background region is <em>not</em> matched when calling the
|
|
<code>hitTestPoint()</code> method with the <code>shapeFlag</code>
|
|
parameter set to <code>true</code>.</p>
|
|
<p>The opaque background region does not respond to mouse events.</p></div></div><div class="field "><a name="parent"></a><h3><p><code><span class="label">read only</span><a href="../../openfl/display/DisplayObject.html#parent"><span class="identifier">parent</span></a>:<a class="type" title="The DisplayObjectContainer class is the base class for all objects that can serve as display object containers on the display list." href="../../openfl/display/DisplayObjectContainer.html">DisplayObjectContainer</a></code></p></h3><div class="doc"><p>Indicates the DisplayObjectContainer object that contains this display
|
|
object. Use the <code>parent</code> property to specify a relative path to
|
|
display objects that are above the current display object in the display
|
|
list hierarchy.</p>
|
|
<p>You can use <code>parent</code> to move up multiple levels in the
|
|
display list as in the following:</p><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>SecurityError</code></th><td><p>The parent display object belongs to a security
|
|
sandbox to which you do not have access. You can
|
|
avoid this situation by having the parent movie call
|
|
the <code><a href="../../openfl/system/Security.html#allowDomain">Security.allowDomain</a>()</code> method.</p></td></tr></div></table></div></div><div class="field "><a name="root"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#root"><span class="identifier">root</span></a>:<a class="type" title="The DisplayObject class is the base class for all objects that can be placed on the display list." href="../../openfl/display/DisplayObject.html">DisplayObject</a></code></p></h3><div class="doc"><p>For a display object in a loaded SWF file, the <code>root</code> property
|
|
is the top-most display object in the portion of the display list's tree
|
|
structure represented by that SWF file. For a Bitmap object representing a
|
|
loaded image file, the <code>root</code> property is the Bitmap object
|
|
itself. For the instance of the main class of the first SWF file loaded,
|
|
the <code>root</code> property is the display object itself. The
|
|
<code>root</code> property of the Stage object is the Stage object itself.
|
|
The <code>root</code> property is set to <code>null</code> for any display
|
|
object that has not been added to the display list, unless it has been
|
|
added to a display object container that is off the display list but that
|
|
is a child of the top-most display object in a loaded SWF file.</p>
|
|
<p>For example, if you create a new Sprite object by calling the
|
|
<code><a href="../../openfl/display/Sprite.html">Sprite</a>()</code> constructor method, its <code>root</code> property
|
|
is <code>null</code> until you add it to the display list(or to a display
|
|
object container that is off the display list but that is a child of the
|
|
top-most display object in a SWF file).</p>
|
|
<p>For a loaded SWF file, even though the Loader object used to load the
|
|
file may not be on the display list, the top-most display object in the
|
|
SWF file has its <code>root</code> property set to itself. The Loader
|
|
object does not have its <code>root</code> property set until it is added
|
|
as a child of a display object for which the <code>root</code> property is
|
|
set.</p></div></div><div class="field "><a name="rotation"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#rotation"><span class="identifier">rotation</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the rotation of the DisplayObject instance, in degrees, from its
|
|
original orientation. Values from 0 to 180 represent clockwise rotation;
|
|
values from 0 to -180 represent counterclockwise rotation. Values outside
|
|
this range are added to or subtracted from 360 to obtain a value within
|
|
the range. For example, the statement <code>my_video.rotation = 450</code>
|
|
is the same as <code> my_video.rotation = 90</code>.</p></div></div><div class="field "><a name="scale9Grid"></a><h3><p><code><a href="../../openfl/display/DisplayObject.html#scale9Grid"><span class="identifier">scale9Grid</span></a>:<a class="type" title="A Rectangle object is an area defined by its position, as indicated by its top-left corner point(x, y) and by its width and its height." href="../../openfl/geom/Rectangle.html">Rectangle</a></code></p></h3><div class="doc"><p>The current scaling grid that is in effect. If set to <code>null</code>,
|
|
the entire display object is scaled normally when any scale transformation
|
|
is applied.</p>
|
|
<p>When you define the <code>scale9Grid</code> property, the display
|
|
object is divided into a grid with nine regions based on the
|
|
<code>scale9Grid</code> rectangle, which defines the center region of the
|
|
grid. The eight other regions of the grid are the following areas: </p><ul><li>The upper-left corner outside of the rectangle</li><li>The area above the rectangle </li><li>The upper-right corner outside of the rectangle</li><li>The area to the left of the rectangle</li><li>The area to the right of the rectangle</li><li>The lower-left corner outside of the rectangle</li><li>The area below the rectangle</li><li>The lower-right corner outside of the rectangle</li></ul>
|
|
<p>You can think of the eight regions outside of the center(defined by
|
|
the rectangle) as being like a picture frame that has special rules
|
|
applied to it when scaled.</p>
|
|
<p>When the <code>scale9Grid</code> property is set and a display object
|
|
is scaled, all text and gradients are scaled normally; however, for other
|
|
types of objects the following rules apply:</p><ul><li>Content in the center region is scaled normally. </li><li>Content in the corners is not scaled. </li><li>Content in the top and bottom regions is scaled horizontally only.
|
|
Content in the left and right regions is scaled vertically only.</li><li>All fills(including bitmaps, video, and gradients) are stretched to
|
|
fit their shapes.</li></ul>
|
|
<p>If a display object is rotated, all subsequent scaling is normal(and
|
|
the <code>scale9Grid</code> property is ignored).</p>
|
|
<p>For example, consider the following display object and a rectangle that
|
|
is applied as the display object's <code>scale9Grid</code>:</p>
|
|
<p>A common use for setting <code>scale9Grid</code> is to set up a display
|
|
object to be used as a component, in which edge regions retain the same
|
|
width when the component is scaled.</p><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>ArgumentError</code></th><td><p>If you pass an invalid argument to the method.</p></td></tr></div></table></div></div><div class="field "><a name="scaleX"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#scaleX"><span class="identifier">scaleX</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the horizontal scale(percentage) of the object as applied from
|
|
the registration point. The default registration point is(0,0). 1.0
|
|
equals 100% scale.</p>
|
|
<p>Scaling the local coordinate system changes the <code>x</code> and
|
|
<code>y</code> property values, which are defined in whole pixels.</p></div></div><div class="field "><a name="scaleY"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#scaleY"><span class="identifier">scaleY</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the vertical scale(percentage) of an object as applied from the
|
|
registration point of the object. The default registration point is(0,0).
|
|
1.0 is 100% scale.</p>
|
|
<p>Scaling the local coordinate system changes the <code>x</code> and
|
|
<code>y</code> property values, which are defined in whole pixels.</p></div></div><div class="field "><a name="scrollRect"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#scrollRect"><span class="identifier">scrollRect</span></a>:<a class="type" title="A Rectangle object is an area defined by its position, as indicated by its top-left corner point(x, y) and by its width and its height." href="../../openfl/geom/Rectangle.html">Rectangle</a></code></p></h3><div class="doc"><p>The scroll rectangle bounds of the display object. The display object is
|
|
cropped to the size defined by the rectangle, and it scrolls within the
|
|
rectangle when you change the <code>x</code> and <code>y</code> properties
|
|
of the <code>scrollRect</code> object.</p>
|
|
<p>The properties of the <code>scrollRect</code> Rectangle object use the
|
|
display object's coordinate space and are scaled just like the overall
|
|
display object. The corner bounds of the cropped window on the scrolling
|
|
display object are the origin of the display object(0,0) and the point
|
|
defined by the width and height of the rectangle. They are not centered
|
|
around the origin, but use the origin to define the upper-left corner of
|
|
the area. A scrolled display object always scrolls in whole pixel
|
|
increments. </p>
|
|
<p>You can scroll an object left and right by setting the <code>x</code>
|
|
property of the <code>scrollRect</code> Rectangle object. You can scroll
|
|
an object up and down by setting the <code>y</code> property of the
|
|
<code>scrollRect</code> Rectangle object. If the display object is rotated
|
|
90° and you scroll it left and right, the display object actually scrolls
|
|
up and down.</p></div></div><div class="field "><a name="stage"></a><h3><p><code><span class="label">read only</span><a href="../../openfl/display/DisplayObject.html#stage"><span class="identifier">stage</span></a>:<a class="type" title="The Stage class represents the main drawing area." href="../../openfl/display/Stage.html">Stage</a></code></p></h3><div class="doc"><p>The Stage of the display object. A Flash runtime application has only one
|
|
Stage object. For example, you can create and load multiple display
|
|
objects into the display list, and the <code>stage</code> property of each
|
|
display object refers to the same Stage object(even if the display object
|
|
belongs to a loaded SWF file).</p>
|
|
<p>If a display object is not added to the display list, its
|
|
<code>stage</code> property is set to <code>null</code>.</p></div></div><div class="field "><a name="transform"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#transform"><span class="identifier">transform</span></a>:<a class="type" title="The Transform class provides access to color adjustment properties and two- or three-dimensional transformation objects that can be applied to a display object." href="../../openfl/geom/Transform.html">Transform</a></code></p></h3><div class="doc"><p>An object with properties pertaining to a display object's matrix, color
|
|
transform, and pixel bounds. The specific properties - matrix,
|
|
colorTransform, and three read-only properties
|
|
(<code>concatenatedMatrix</code>, <code>concatenatedColorTransform</code>,
|
|
and <code>pixelBounds</code>) - are described in the entry for the
|
|
Transform class.</p>
|
|
<p>Each of the transform object's properties is itself an object. This
|
|
concept is important because the only way to set new values for the matrix
|
|
or colorTransform objects is to create a new object and copy that object
|
|
into the transform.matrix or transform.colorTransform property.</p>
|
|
<p>For example, to increase the <code>tx</code> value of a display
|
|
object's matrix, you must make a copy of the entire matrix object, then
|
|
copy the new object into the matrix property of the transform object:
|
|
<code> var myMatrix:<a href="../../openfl/geom/Matrix.html">Matrix</a> =
|
|
myDisplayObject.transform.matrix; myMatrix.tx += 10;
|
|
myDisplayObject.transform.matrix = myMatrix; </code></p>
|
|
<p>You cannot directly set the <code>tx</code> property. The following
|
|
code has no effect on <code>myDisplayObject</code>:
|
|
<code> myDisplayObject.transform.matrix.tx +=
|
|
10; </code></p>
|
|
<p>You can also copy an entire transform object and assign it to another
|
|
display object's transform property. For example, the following code
|
|
copies the entire transform object from <code>myOldDisplayObj</code> to
|
|
<code>myNewDisplayObj</code>:
|
|
<code>myNewDisplayObj.transform = myOldDisplayObj.transform;</code></p>
|
|
<p>The resulting display object, <code>myNewDisplayObj</code>, now has the
|
|
same values for its matrix, color transform, and pixel bounds as the old
|
|
display object, <code>myOldDisplayObj</code>.</p>
|
|
<p>Note that AIR for TV devices use hardware acceleration, if it is
|
|
available, for color transforms.</p></div></div><div class="field "><a name="visible"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#visible"><span class="identifier">visible</span></a>:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Whether or not the display object is visible. Display objects that are not
|
|
visible are disabled. For example, if <code>visible=false</code> for an
|
|
InteractiveObject instance, it cannot be clicked.</p></div></div><div class="field "><a name="width"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#width"><span class="identifier">width</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the width of the display object, in pixels. The width is
|
|
calculated based on the bounds of the content of the display object. When
|
|
you set the <code>width</code> property, the <code>scaleX</code> property
|
|
is adjusted accordingly, as shown in the following code:</p>
|
|
<p>Except for TextField and Video objects, a display object with no
|
|
content(such as an empty sprite) has a width of 0, even if you try to set
|
|
<code>width</code> to a different value.</p></div></div><div class="field "><a name="x"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#x"><span class="identifier">x</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the <em>x</em> coordinate of the DisplayObject instance relative
|
|
to the local coordinates of the parent DisplayObjectContainer. If the
|
|
object is inside a DisplayObjectContainer that has transformations, it is
|
|
in the local coordinate system of the enclosing DisplayObjectContainer.
|
|
Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the
|
|
DisplayObjectContainer's children inherit a coordinate system that is
|
|
rotated 90° counterclockwise. The object's coordinates refer to the
|
|
registration point position.</p></div></div><div class="field "><a name="y"></a><h3><p><code><span class="label">read only</span><span class="label">write only</span><a href="../../openfl/display/DisplayObject.html#y"><span class="identifier">y</span></a>:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></code></p></h3><div class="doc"><p>Indicates the <em>y</em> coordinate of the DisplayObject instance relative
|
|
to the local coordinates of the parent DisplayObjectContainer. If the
|
|
object is inside a DisplayObjectContainer that has transformations, it is
|
|
in the local coordinate system of the enclosing DisplayObjectContainer.
|
|
Thus, for a DisplayObjectContainer rotated 90° counterclockwise, the
|
|
DisplayObjectContainer's children inherit a coordinate system that is
|
|
rotated 90° counterclockwise. The object's coordinates refer to the
|
|
registration point position.</p></div></div></div><div style="display:none"></div></div><h3 class="section">Inherited Methods</h3><div class="fields"><h4><a href="#" class="expand-button"><i class="fa fa-arrow-circle-o-right"></i></a> Defined by <a class="type" title="The TextField class is used to create display objects for text display and input." href="../../openfl/text/TextField.html">TextField</a></h4><div style="display:none"><div class="field "><a name="appendText"></a><h3><p><code><a href="#appendText"><span class="identifier">appendText</span></a> (<span style="white-space:nowrap">text:<a class="type" title="The basic String class." href="../../String.html">String</a></span>):<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>Appends the string specified by the <code>newText</code> parameter to the
|
|
end of the text of the text field. This method is more efficient than an
|
|
addition assignment(<code>+=</code>) on a <code>text</code> property
|
|
(such as <code>someTextField.text += moreText</code>), particularly for a
|
|
text field that contains a significant amount of content.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>newText</code></th><td><p>The string to append to the existing text.</p></td></tr></table></div></div><div class="field "><a name="getCharBoundaries"></a><h3><p><code><a href="#getCharBoundaries"><span class="identifier">getCharBoundaries</span></a> (<span style="white-space:nowrap">charIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="A Rectangle object is an area defined by its position, as indicated by its top-left corner point(x, y) and by its width and its height." href="../../openfl/geom/Rectangle.html">Rectangle</a></code></p></h3><div class="doc"><p>Returns a rectangle that is the bounding box of the character.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>charIndex</code></th><td><p>The zero-based index value for the character(for
|
|
example, the first position is 0, the second position is
|
|
1, and so on).</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>A rectangle with <code>x</code> and <code>y</code> minimum and
|
|
maximum values defining the bounding box of the character.</p></div></div></div><div class="field "><a name="getCharIndexAtPoint"></a><h3><p><code><a href="#getCharIndexAtPoint"><span class="identifier">getCharIndexAtPoint</span></a> (<span style="white-space:nowrap">x:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a>,</span> <span style="white-space:nowrap">y:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></span>):<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>Returns the zero-based index value of the character at the point specified
|
|
by the <code>x</code> and <code>y</code> parameters.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>x</code></th><td><p>The <em>x</em> coordinate of the character.</p></td></tr><tr><th width="25%"><code>y</code></th><td><p>The <em>y</em> coordinate of the character.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The zero-based index value of the character(for example, the
|
|
first position is 0, the second position is 1, and so on). Returns
|
|
-1 if the point is not over any character.</p></div></div></div><div class="field "><a name="getFirstCharInParagraph"></a><h3><p><code><a href="#getFirstCharInParagraph"><span class="identifier">getFirstCharInParagraph</span></a> (<span style="white-space:nowrap">charIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="getLineIndexAtPoint"></a><h3><p><code><a href="#getLineIndexAtPoint"><span class="identifier">getLineIndexAtPoint</span></a> (<span style="white-space:nowrap">x:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a>,</span> <span style="white-space:nowrap">y:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a></span>):<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>Returns the zero-based index value of the line at the point specified by
|
|
the <code>x</code> and <code>y</code> parameters.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>x</code></th><td><p>The <em>x</em> coordinate of the line.</p></td></tr><tr><th width="25%"><code>y</code></th><td><p>The <em>y</em> coordinate of the line.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The zero-based index value of the line(for example, the first
|
|
line is 0, the second line is 1, and so on). Returns -1 if the
|
|
point is not over any line.</p></div></div></div><div class="field "><a name="getLineIndexOfChar"></a><h3><p><code><a href="#getLineIndexOfChar"><span class="identifier">getLineIndexOfChar</span></a> (<span style="white-space:nowrap">charIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="getLineLength"></a><h3><p><code><a href="#getLineLength"><span class="identifier">getLineLength</span></a> (<span style="white-space:nowrap">lineIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="getLineMetrics"></a><h3><p><code><a href="#getLineMetrics"><span class="identifier">getLineMetrics</span></a> (<span style="white-space:nowrap">lineIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="The TextLineMetrics class contains information about the text position and measurements of a line of text within a text field." href="../../openfl/text/TextLineMetrics.html">TextLineMetrics</a></code></p></h3><div class="doc"><p>Returns metrics information about a given text line.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>lineIndex</code></th><td><p>The line number for which you want metrics information.</p></td></tr></table><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>RangeError</code></th><td><p>The line number specified is out of range.</p></td></tr></div></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>A TextLineMetrics object.</p></div></div></div><div class="field "><a name="getLineOffset"></a><h3><p><code><a href="#getLineOffset"><span class="identifier">getLineOffset</span></a> (<span style="white-space:nowrap">lineIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p>Returns the character index of the first character in the line that the
|
|
<code>lineIndex</code> parameter specifies.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>lineIndex</code></th><td><p>The zero-based index value of the line(for example, the
|
|
first line is 0, the second line is 1, and so on).</p></td></tr></table><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>RangeError</code></th><td><p>The line number specified is out of range.</p></td></tr></div></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The zero-based index value of the first character in the line.</p></div></div></div><div class="field "><a name="getLineText"></a><h3><p><code><a href="#getLineText"><span class="identifier">getLineText</span></a> (<span style="white-space:nowrap">lineIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="The basic String class." href="../../String.html">String</a></code></p></h3><div class="doc"><p>Returns the text of the line specified by the <code>lineIndex</code>
|
|
parameter.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>lineIndex</code></th><td><p>The zero-based index value of the line(for example, the
|
|
first line is 0, the second line is 1, and so on).</p></td></tr></table><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>RangeError</code></th><td><p>The line number specified is out of range.</p></td></tr></div></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The text string contained in the specified line.</p></div></div></div><div class="field "><a name="getParagraphLength"></a><h3><p><code><a href="#getParagraphLength"><span class="identifier">getParagraphLength</span></a> (<span style="white-space:nowrap">charIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="The standard Int type." href="../../Int.html">Int</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="getTextFormat"></a><h3><p><code><a href="#getTextFormat"><span class="identifier">getTextFormat</span></a> (<span style="white-space:nowrap">beginIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a> = 0,</span> <span style="white-space:nowrap">endIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a> = 0</span>):<a class="type" title="The TextFormat class represents character formatting information." href="../../openfl/text/TextFormat.html">TextFormat</a></code></p></h3><div class="doc"><p>Returns a TextFormat object that contains formatting information for the
|
|
range of text that the <code>beginIndex</code> and <code>endIndex</code>
|
|
parameters specify. Only properties that are common to the entire text
|
|
specified are set in the resulting TextFormat object. Any property that is
|
|
<em>mixed</em>, meaning that it has different values at different points in
|
|
the text, has a value of <code>null</code>.</p>
|
|
<p>If you do not specify values for these parameters, this method is
|
|
applied to all the text in the text field. </p>
|
|
<p>The following table describes three possible usages:</p><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>RangeError</code></th><td><p>The <code>beginIndex</code> or <code>endIndex</code>
|
|
specified is out of range.</p></td></tr></div></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The TextFormat object that represents the formatting properties
|
|
for the specified text.</p></div></div></div><div class="field "><a name="replaceSelectedText"></a><h3><p><code><a href="#replaceSelectedText"><span class="identifier">replaceSelectedText</span></a> (<span style="white-space:nowrap">value:<a class="type" title="The basic String class." href="../../String.html">String</a></span>):<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="replaceText"></a><h3><p><code><a href="#replaceText"><span class="identifier">replaceText</span></a> (<span style="white-space:nowrap">beginIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a>,</span> <span style="white-space:nowrap">endIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a>,</span> <span style="white-space:nowrap">newText:<a class="type" title="The basic String class." href="../../String.html">String</a></span>):<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="setSelection"></a><h3><p><code><a href="#setSelection"><span class="identifier">setSelection</span></a> (<span style="white-space:nowrap">beginIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a>,</span> <span style="white-space:nowrap">endIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a></span>):<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>Sets as selected the text designated by the index values of the first and
|
|
last characters, which are specified with the <code>beginIndex</code> and
|
|
<code>endIndex</code> parameters. If the two parameter values are the
|
|
same, this method sets the insertion point, as if you set the
|
|
<code>caretIndex</code> property.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>beginIndex</code></th><td><p>The zero-based index value of the first character in the
|
|
selection(for example, the first character is 0, the
|
|
second character is 1, and so on).</p></td></tr><tr><th width="25%"><code>endIndex</code></th><td><p>The zero-based index value of the last character in the
|
|
selection.</p></td></tr></table></div></div><div class="field "><a name="setTextFormat"></a><h3><p><code><a href="#setTextFormat"><span class="identifier">setTextFormat</span></a> (<span style="white-space:nowrap">format:<a class="type" title="The TextFormat class represents character formatting information." href="../../openfl/text/TextFormat.html">TextFormat</a>,</span> <span style="white-space:nowrap">beginIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a> = 0,</span> <span style="white-space:nowrap">endIndex:<a class="type" title="The standard Int type." href="../../Int.html">Int</a> = 0</span>):<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>Applies the text formatting that the <code>format</code> parameter
|
|
specifies to the specified text in a text field. The value of
|
|
<code>format</code> must be a TextFormat object that specifies the desired
|
|
text formatting changes. Only the non-null properties of
|
|
<code>format</code> are applied to the text field. Any property of
|
|
<code>format</code> that is set to <code>null</code> is not applied. By
|
|
default, all of the properties of a newly created TextFormat object are
|
|
set to <code>null</code>.</p>
|
|
<p><strong>Note:</strong> This method does not work if a style sheet is applied to
|
|
the text field.</p>
|
|
<p>The <code>setTextFormat()</code> method changes the text formatting
|
|
applied to a range of characters or to the entire body of text in a text
|
|
field. To apply the properties of format to all text in the text field, do
|
|
not specify values for <code>beginIndex</code> and <code>endIndex</code>.
|
|
To apply the properties of the format to a range of text, specify values
|
|
for the <code>beginIndex</code> and the <code>endIndex</code> parameters.
|
|
You can use the <code>length</code> property to determine the index
|
|
values.</p>
|
|
<p>The two types of formatting information in a TextFormat object are
|
|
character level formatting and paragraph level formatting. Each character
|
|
in a text field can have its own character formatting settings, such as
|
|
font name, font size, bold, and italic.</p>
|
|
<p>For paragraphs, the first character of the paragraph is examined for
|
|
the paragraph formatting settings for the entire paragraph. Examples of
|
|
paragraph formatting settings are left margin, right margin, and
|
|
indentation.</p>
|
|
<p>Any text inserted manually by the user, or replaced by the
|
|
<code>replaceSelectedText()</code> method, receives the default text field
|
|
formatting for new text, and not the formatting specified for the text
|
|
insertion point. To set the default formatting for new text, use
|
|
<code>defaultTextFormat</code>.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>format</code></th><td><p>A TextFormat object that contains character and paragraph
|
|
formatting information.</p></td></tr></table><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>Error</code></th><td><p>This method cannot be used on a text field with a style
|
|
sheet.</p></td></tr></div><div class="indent inline-content"><tr><th width="25%"><code>RangeError</code></th><td><p>The <code>beginIndex</code> or <code>endIndex</code>
|
|
specified is out of range.</p></td></tr></div></table></div></div></div><h4><a href="#" class="expand-button"><i class="fa fa-arrow-circle-o-right"></i></a> Defined by <a class="type" title="The InteractiveObject class is the abstract base class for all display objects with which the user can interact, using the mouse, keyboard, or other user input device." href="../../openfl/display/InteractiveObject.html">InteractiveObject</a></h4><div style="display:none"><div class="field "><a name="requestSoftKeyboard"></a><h3><p><code><a href="#requestSoftKeyboard"><span class="identifier">requestSoftKeyboard</span></a> ():<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Raises a virtual keyboard.</p>
|
|
<p>Calling this method focuses the InteractiveObject instance and raises
|
|
the soft keyboard, if necessary. The <code>needsSoftKeyboard</code> must
|
|
also be <code>true</code>. A keyboard is not raised if a hardware keyboard
|
|
is available, or if the client system does not support virtual
|
|
keyboards.</p>
|
|
<p><strong>Note:</strong> This method is not supported in AIR applications on
|
|
iOS.</p><p class="javadoc">Returns:</p><div class="indent inline-content"><p>A value of <code>true</code> means that the soft keyboard request
|
|
was granted; <code>false</code> means that the soft keyboard was
|
|
not raised.</p></div></div></div></div><h4><a href="#" class="expand-button"><i class="fa fa-arrow-circle-o-right"></i></a> Defined by <a class="type" title="The DisplayObject class is the base class for all objects that can be placed on the display list." href="../../openfl/display/DisplayObject.html">DisplayObject</a></h4><div style="display:none"><div class="field "><a name="getBounds"></a><h3><p><code><a href="#getBounds"><span class="identifier">getBounds</span></a> (<span style="white-space:nowrap">targetCoordinateSpace:<a class="type" title="The DisplayObject class is the base class for all objects that can be placed on the display list." href="../../openfl/display/DisplayObject.html">DisplayObject</a></span>):<a class="type" title="A Rectangle object is an area defined by its position, as indicated by its top-left corner point(x, y) and by its width and its height." href="../../openfl/geom/Rectangle.html">Rectangle</a></code></p></h3><div class="doc"><p>Returns a rectangle that defines the area of the display object relative
|
|
to the coordinate system of the <code>targetCoordinateSpace</code> object.
|
|
Consider the following code, which shows how the rectangle returned can
|
|
vary depending on the <code>targetCoordinateSpace</code> parameter that
|
|
you pass to the method:</p>
|
|
<p><strong>Note:</strong> Use the <code>localToGlobal()</code> and
|
|
<code>globalToLocal()</code> methods to convert the display object's local
|
|
coordinates to display coordinates, or display coordinates to local
|
|
coordinates, respectively.</p>
|
|
<p>The <code>getBounds()</code> method is similar to the
|
|
<code>getRect()</code> method; however, the Rectangle returned by the
|
|
<code>getBounds()</code> method includes any strokes on shapes, whereas
|
|
the Rectangle returned by the <code>getRect()</code> method does not. For
|
|
an example, see the description of the <code>getRect()</code> method.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>targetCoordinateSpace</code></th><td><p>The display object that defines the
|
|
coordinate system to use.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The rectangle that defines the area of the display object relative
|
|
to the <code>targetCoordinateSpace</code> object's coordinate
|
|
system.</p></div></div></div><div class="field "><a name="getRect"></a><h3><p><code><a href="#getRect"><span class="identifier">getRect</span></a> (<span style="white-space:nowrap">targetCoordinateSpace:<a class="type" title="The DisplayObject class is the base class for all objects that can be placed on the display list." href="../../openfl/display/DisplayObject.html">DisplayObject</a></span>):<a class="type" title="A Rectangle object is an area defined by its position, as indicated by its top-left corner point(x, y) and by its width and its height." href="../../openfl/geom/Rectangle.html">Rectangle</a></code></p></h3><div class="doc"><p>Returns a rectangle that defines the boundary of the display object, based
|
|
on the coordinate system defined by the <code>targetCoordinateSpace</code>
|
|
parameter, excluding any strokes on shapes. The values that the
|
|
<code>getRect()</code> method returns are the same or smaller than those
|
|
returned by the <code>getBounds()</code> method.</p>
|
|
<p><strong>Note:</strong> Use <code>localToGlobal()</code> and
|
|
<code>globalToLocal()</code> methods to convert the display object's local
|
|
coordinates to Stage coordinates, or Stage coordinates to local
|
|
coordinates, respectively.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>targetCoordinateSpace</code></th><td><p>The display object that defines the
|
|
coordinate system to use.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>The rectangle that defines the area of the display object relative
|
|
to the <code>targetCoordinateSpace</code> object's coordinate
|
|
system.</p></div></div></div><div class="field "><a name="globalToLocal"></a><h3><p><code><a href="#globalToLocal"><span class="identifier">globalToLocal</span></a> (<span style="white-space:nowrap">pos:<a class="type" title="The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis." href="../../openfl/geom/Point.html">Point</a></span>):<a class="type" title="The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis." href="../../openfl/geom/Point.html">Point</a></code></p></h3><div class="doc"><p>Converts the <code>point</code> object from the Stage(global) coordinates
|
|
to the display object's(local) coordinates.</p>
|
|
<p>To use this method, first create an instance of the Point class. The
|
|
<em>x</em> and <em>y</em> values that you assign represent global coordinates
|
|
because they relate to the origin(0,0) of the main display area. Then
|
|
pass the Point instance as the parameter to the
|
|
<code>globalToLocal()</code> method. The method returns a new Point object
|
|
with <em>x</em> and <em>y</em> values that relate to the origin of the display
|
|
object instead of the origin of the Stage.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>point</code></th><td><p>An object created with the Point class. The Point object
|
|
specifies the <em>x</em> and <em>y</em> coordinates as
|
|
properties.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>A Point object with coordinates relative to the display object.</p></div></div></div><div class="field "><a name="hitTestObject"></a><h3><p><code><a href="#hitTestObject"><span class="identifier">hitTestObject</span></a> (<span style="white-space:nowrap">obj:<a class="type" title="The DisplayObject class is the base class for all objects that can be placed on the display list." href="../../openfl/display/DisplayObject.html">DisplayObject</a></span>):<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Evaluates the bounding box of the display object to see if it overlaps or
|
|
intersects with the bounding box of the <code>obj</code> display object.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>obj</code></th><td><p>The display object to test against.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p><code>true</code> if the bounding boxes of the display objects
|
|
intersect; <code>false</code> if not.</p></div></div></div><div class="field "><a name="hitTestPoint"></a><h3><p><code><a href="#hitTestPoint"><span class="identifier">hitTestPoint</span></a> (<span style="white-space:nowrap">x:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a>,</span> <span style="white-space:nowrap">y:<a class="type" title="The standard Float type, this is a double-precision IEEE 64bit float." href="../../Float.html">Float</a>,</span> <span style="white-space:nowrap">shapeFlag:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a> = false</span>):<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Evaluates the display object to see if it overlaps or intersects with the
|
|
point specified by the <code>x</code> and <code>y</code> parameters. The
|
|
<code>x</code> and <code>y</code> parameters specify a point in the
|
|
coordinate space of the Stage, not the display object container that
|
|
contains the display object(unless that display object container is the
|
|
Stage).</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>x</code></th><td><p>The <em>x</em> coordinate to test against this object.</p></td></tr><tr><th width="25%"><code>y</code></th><td><p>The <em>y</em> coordinate to test against this object.</p></td></tr><tr><th width="25%"><code>shapeFlag</code></th><td><p>Whether to check against the actual pixels of the object
|
|
(<code>true</code>) or the bounding box
|
|
(<code>false</code>).</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p><code>true</code> if the display object overlaps or intersects
|
|
with the specified point; <code>false</code> otherwise.</p></div></div></div><div class="field "><a name="localToGlobal"></a><h3><p><code><a href="#localToGlobal"><span class="identifier">localToGlobal</span></a> (<span style="white-space:nowrap">point:<a class="type" title="The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis." href="../../openfl/geom/Point.html">Point</a></span>):<a class="type" title="The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis." href="../../openfl/geom/Point.html">Point</a></code></p></h3><div class="doc"><p>Converts the <code>point</code> object from the display object's(local)
|
|
coordinates to the Stage(global) coordinates.</p>
|
|
<p>This method allows you to convert any given <em>x</em> and <em>y</em>
|
|
coordinates from values that are relative to the origin(0,0) of a
|
|
specific display object(local coordinates) to values that are relative to
|
|
the origin of the Stage(global coordinates).</p>
|
|
<p>To use this method, first create an instance of the Point class. The
|
|
<em>x</em> and <em>y</em> values that you assign represent local coordinates
|
|
because they relate to the origin of the display object.</p>
|
|
<p>You then pass the Point instance that you created as the parameter to
|
|
the <code>localToGlobal()</code> method. The method returns a new Point
|
|
object with <em>x</em> and <em>y</em> values that relate to the origin of the
|
|
Stage instead of the origin of the display object.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>point</code></th><td><p>The name or identifier of a point created with the Point
|
|
class, specifying the <em>x</em> and <em>y</em> coordinates as
|
|
properties.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>A Point object with coordinates relative to the Stage.</p></div></div></div></div><h4><a href="#" class="expand-button"><i class="fa fa-arrow-circle-o-right"></i></a> Defined by <a class="type" title="The EventDispatcher class is the base class for all classes that dispatch events." href="../../openfl/events/EventDispatcher.html">EventDispatcher</a></h4><div style="display:none"><div class="field "><a name="addEventListener"></a><h3><p><code><a href="#addEventListener"><span class="identifier">addEventListener</span></a> (<span style="white-space:nowrap">type:<a class="type" title="The basic String class." href="../../String.html">String</a>,</span> <span style="white-space:nowrap">listener:<a class="type" title="Dynamic is a special type which is compatible with all other types." href="../../Dynamic.html">Dynamic</a> ‑> <a class="type" title="The standard Void type." href="../../Void.html">Void</a>,</span> <span style="white-space:nowrap">useCapture:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a> = false,</span> <span style="white-space:nowrap">priority:<a class="type" title="The standard Int type." href="../../Int.html">Int</a> = 0,</span> <span style="white-space:nowrap">useWeakReference:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a> = false</span>):<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>Registers an event listener object with an EventDispatcher object so that
|
|
the listener receives notification of an event. You can register event
|
|
listeners on all nodes in the display list for a specific type of event,
|
|
phase, and priority.</p>
|
|
<p>After you successfully register an event listener, you cannot change
|
|
its priority through additional calls to <code>addEventListener()</code>.
|
|
To change a listener's priority, you must first call
|
|
<code>removeListener()</code>. Then you can register the listener again
|
|
with the new priority level. </p>
|
|
<p>Keep in mind that after the listener is registered, subsequent calls to
|
|
<code>addEventListener()</code> with a different <code>type</code> or
|
|
<code>useCapture</code> value result in the creation of a separate
|
|
listener registration. For example, if you first register a listener with
|
|
<code>useCapture</code> set to <code>true</code>, it listens only during
|
|
the capture phase. If you call <code>addEventListener()</code> again using
|
|
the same listener object, but with <code>useCapture</code> set to
|
|
<code>false</code>, you have two separate listeners: one that listens
|
|
during the capture phase and another that listens during the target and
|
|
bubbling phases. </p>
|
|
<p>You cannot register an event listener for only the target phase or the
|
|
bubbling phase. Those phases are coupled during registration because
|
|
bubbling applies only to the ancestors of the target node.</p>
|
|
<p>If you no longer need an event listener, remove it by calling
|
|
<code>removeEventListener()</code>, or memory problems could result. Event
|
|
listeners are not automatically removed from memory because the garbage
|
|
collector does not remove the listener as long as the dispatching object
|
|
exists(unless the <code>useWeakReference</code> parameter is set to
|
|
<code>true</code>).</p>
|
|
<p>Copying an EventDispatcher instance does not copy the event listeners
|
|
attached to it.(If your newly created node needs an event listener, you
|
|
must attach the listener after creating the node.) However, if you move an
|
|
EventDispatcher instance, the event listeners attached to it move along
|
|
with it.</p>
|
|
<p>If the event listener is being registered on a node while an event is
|
|
being processed on this node, the event listener is not triggered during
|
|
the current phase but can be triggered during a later phase in the event
|
|
flow, such as the bubbling phase.</p>
|
|
<p>If an event listener is removed from a node while an event is being
|
|
processed on the node, it is still triggered by the current actions. After
|
|
it is removed, the event listener is never invoked again(unless
|
|
registered again for future processing). </p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>type</code></th><td><p>The type of event.</p></td></tr><tr><th width="25%"><code>useCapture</code></th><td><p>Determines whether the listener works in the
|
|
capture phase or the target and bubbling phases.
|
|
If <code>useCapture</code> is set to
|
|
<code>true</code>, the listener processes the
|
|
event only during the capture phase and not in the
|
|
target or bubbling phase. If
|
|
<code>useCapture</code> is <code>false</code>, the
|
|
listener processes the event only during the
|
|
target or bubbling phase. To listen for the event
|
|
in all three phases, call
|
|
<code>addEventListener</code> twice, once with
|
|
<code>useCapture</code> set to <code>true</code>,
|
|
then again with <code>useCapture</code> set to
|
|
<code>false</code>.</p></td></tr><tr><th width="25%"><code>priority</code></th><td><p>The priority level of the event listener. The
|
|
priority is designated by a signed 32-bit integer.
|
|
The higher the number, the higher the priority.
|
|
All listeners with priority <em>n</em> are processed
|
|
before listeners of priority <em>n</em>-1. If two or
|
|
more listeners share the same priority, they are
|
|
processed in the order in which they were added.
|
|
The default priority is 0.</p></td></tr><tr><th width="25%"><code>useWeakReference</code></th><td><p>Determines whether the reference to the listener
|
|
is strong or weak. A strong reference(the
|
|
default) prevents your listener from being
|
|
garbage-collected. A weak reference does not.</p>
|
|
<p>Class-level member functions are not subject to
|
|
garbage collection, so you can set
|
|
<code>useWeakReference</code> to <code>true</code>
|
|
for class-level member functions without
|
|
subjecting them to garbage collection. If you set
|
|
<code>useWeakReference</code> to <code>true</code>
|
|
for a listener that is a nested inner function,
|
|
the function will be garbage-collected and no
|
|
longer persistent. If you create references to the
|
|
inner function(save it in another variable) then
|
|
it is not garbage-collected and stays
|
|
persistent.</p></td></tr></table><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>ArgumentError</code></th><td><p>The <code>listener</code> specified is not a
|
|
function.</p></td></tr></div></table></div></div><div class="field "><a name="dispatchEvent"></a><h3><p><code><a href="#dispatchEvent"><span class="identifier">dispatchEvent</span></a> (<span style="white-space:nowrap">event:<a class="type" title="The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event listeners when an event occurs." href="../../openfl/events/Event.html">Event</a></span>):<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Dispatches an event into the event flow. The event target is the
|
|
EventDispatcher object upon which the <code>dispatchEvent()</code> method
|
|
is called.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>event</code></th><td><p>The Event object that is dispatched into the event flow. If
|
|
the event is being redispatched, a clone of the event is
|
|
created automatically. After an event is dispatched, its
|
|
<code>target</code> property cannot be changed, so you must
|
|
create a new copy of the event for redispatching to work.</p></td></tr></table><p class="javadoc">Throws:</p><table class="table table-bordered params"><div class="indent inline-content"><tr><th width="25%"><code>Error</code></th><td><p>The event dispatch recursion limit has been reached.</p></td></tr></div></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>A value of <code>true</code> if the event was successfully
|
|
dispatched. A value of <code>false</code> indicates failure or
|
|
that <code>preventDefault()</code> was called on the event.</p></div></div></div><div class="field "><a name="hasEventListener"></a><h3><p><code><a href="#hasEventListener"><span class="identifier">hasEventListener</span></a> (<span style="white-space:nowrap">type:<a class="type" title="The basic String class." href="../../String.html">String</a></span>):<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Checks whether the EventDispatcher object has any listeners registered for
|
|
a specific type of event. This allows you to determine where an
|
|
EventDispatcher object has altered handling of an event type in the event
|
|
flow hierarchy. To determine whether a specific event type actually
|
|
triggers an event listener, use <code>willTrigger()</code>.</p>
|
|
<p>The difference between <code>hasEventListener()</code> and
|
|
<code>willTrigger()</code> is that <code>hasEventListener()</code>
|
|
examines only the object to which it belongs, whereas
|
|
<code>willTrigger()</code> examines the entire event flow for the event
|
|
specified by the <code>type</code> parameter. </p>
|
|
<p>When <code>hasEventListener()</code> is called from a LoaderInfo
|
|
object, only the listeners that the caller can access are considered.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>type</code></th><td><p>The type of event.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>A value of <code>true</code> if a listener of the specified type
|
|
is registered; <code>false</code> otherwise.</p></div></div></div><div class="field "><a name="removeEventListener"></a><h3><p><code><a href="#removeEventListener"><span class="identifier">removeEventListener</span></a> (<span style="white-space:nowrap">type:<a class="type" title="The basic String class." href="../../String.html">String</a>,</span> <span style="white-space:nowrap">listener:<a class="type" title="Dynamic is a special type which is compatible with all other types." href="../../Dynamic.html">Dynamic</a> ‑> <a class="type" title="The standard Void type." href="../../Void.html">Void</a>,</span> <span style="white-space:nowrap">useCapture:<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a> = false</span>):<a class="type" title="The standard Void type." href="../../Void.html">Void</a></code></p></h3><div class="doc"><p>Removes a listener from the EventDispatcher object. If there is no
|
|
matching listener registered with the EventDispatcher object, a call to
|
|
this method has no effect.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>type</code></th><td><p>The type of event.</p></td></tr><tr><th width="25%"><code>useCapture</code></th><td><p>Specifies whether the listener was registered for the
|
|
capture phase or the target and bubbling phases. If the
|
|
listener was registered for both the capture phase and
|
|
the target and bubbling phases, two calls to
|
|
<code>removeEventListener()</code> are required to
|
|
remove both, one call with <code>useCapture()</code> set
|
|
to <code>true</code>, and another call with
|
|
<code>useCapture()</code> set to <code>false</code>.</p></td></tr></table></div></div><div class="field "><a name="toString"></a><h3><p><code><a href="#toString"><span class="identifier">toString</span></a> ():<a class="type" title="The basic String class." href="../../String.html">String</a></code></p></h3><div class="doc"><p></p></div></div><div class="field "><a name="willTrigger"></a><h3><p><code><a href="#willTrigger"><span class="identifier">willTrigger</span></a> (<span style="white-space:nowrap">type:<a class="type" title="The basic String class." href="../../String.html">String</a></span>):<a class="type" title="The standard Boolean type, which can either be true or false." href="../../Bool.html">Bool</a></code></p></h3><div class="doc"><p>Checks whether an event listener is registered with this EventDispatcher
|
|
object or any of its ancestors for the specified event type. This method
|
|
returns <code>true</code> if an event listener is triggered during any
|
|
phase of the event flow when an event of the specified type is dispatched
|
|
to this EventDispatcher object or any of its descendants.</p>
|
|
<p>The difference between the <code>hasEventListener()</code> and the
|
|
<code>willTrigger()</code> methods is that <code>hasEventListener()</code>
|
|
examines only the object to which it belongs, whereas the
|
|
<code>willTrigger()</code> method examines the entire event flow for the
|
|
event specified by the <code>type</code> parameter. </p>
|
|
<p>When <code>willTrigger()</code> is called from a LoaderInfo object,
|
|
only the listeners that the caller can access are considered.</p><p class="javadoc">Parameters:</p><table class="table table-bordered params"><tr><th width="25%"><code>type</code></th><td><p>The type of event.</p></td></tr></table><p class="javadoc">Returns:</p><div class="indent inline-content"><p>A value of <code>true</code> if a listener of the specified type
|
|
will be triggered; <code>false</code> otherwise.</p></div></div></div></div></div></div></div></div></div></div><footer class="section site-footer" style="background:#FAFAFA"><div class="container"><div class="copyright"><p style="color:#777777">© 2017 <a style="color:#777777" href="http://www.openfl.org">http://www.openfl.org</a></p></div></div></footer><script src="../..//highlighter.js"></script><link href="../../highlighter.css" rel="stylesheet"/></body></html> |