"String" fullName="String" packageName="" relativePath="../../String.html"/>
This event has the following properties:preDataChange
event object. This event object is dispatched before a change is made to component data.
]]>Property Value bubblesfalsecancelablefalse; there is no default behavior to cancel.changeTypeIdentifies the type of change to be made. currentTargetThe object that is actively processing
the event object with an event listener. endIndexIdentifies the index of the last item to be
changed. itemsAn array that lists the items to be changed. startIndexIdentifies the index of the first item to be
changed. targetThe object that dispatched the event. The target is
not always the object listening for the event. Use the currentTarget
property to access the object that is listening for the event.preDataChange
event object.]]>
Sign extension matters only when you read data, not when you write it. Therefore, you do not need separate
write methods to work with IDataInput.readUnsignedByte() and
IDataInput.readUnsignedShort(). In other words:
IDataOutput.writeByte() with IDataInput.readUnsignedByte() and
IDataInput.readByte().IDataOutput.writeShort() with IDataInput.readUnsignedShort() and
IDataInput.readShort().bytes,
starting offset(zero-based index) bytes
into the byte stream.
If the length parameter is omitted, the default
length of 0 is used; Flash Player writes the entire buffer starting at
offset.
If the offset parameter is also omitted, the entire buffer is
written.
If the offset or length parameter
is out of range, they are clamped to the beginning and end
of the bytes array.
bytes,
starting offset(zero-based index) bytes
into the byte stream.]]>true or 0 if false.
]]>false, Flash Player writes a 0.
]]>"cn-gb", "iso-8859-1" and others.
For a complete list, see Supported Character Sets.
]]>getProperty and provide custom behavior. If you try to use a method of
the Proxy class without overriding the method, an exception is thrown.
And, keep in mind, your own code overriding the methods of the Proxy class can throw
exceptions unintentionally. Throwing exceptions when using these methods causes problems because
the calling code (using operators like in, is, delete and others)
does not expect exceptions. Unless you're already sure your overriding method does not throw exceptions,
Adobe recommends using try..catch statements around your implementation of the Proxy class
to avoid fatal errors when operators call your methods. For example:
The Proxy class is a replacement for the
Object.__resolve and Object.addProperty
features of ActionScript 2.0, which are no longer
available in ActionScript 3.0. The Object.addProperty() feature allowed you to
dynamically create get and set methods in ActionScript 2.0. Although ActionScript 3.0
provides get and set methods at compile time, you cannot dynamically assign one
to an object unless you use the Proxy class.
To avoid collisions with the public namespace,
the methods of the Proxy class are in the
flash_proxy namespace.
Where methods of the Proxy class take a name
argument, name can be either a String or
a QName object (if namespaces are being used).
false.
]]>
false.
]]>
descendant operator is used, this method
is invoked.
]]>for each..in loops on the object to retrieve property index values.
For example:
for each..in loops on the object to retrieve the desired names.
For example (with code from Proxy.nextNameIndex()):
for each..in loops on the object to retrieve the desired values.
For example (with code from Proxy.nextNameIndex()):
name is a QName that is also
marked as an attribute.
]]>
toString() on it.
Primitive (built-in) objects, like Numbers, in a Dictionary collection behave in the same manner as they do when
they are the property of a regular object.
The following statements show the relationship between a Dictionary object and a key object:
var dict = new Dictionary();
var obj = new Object();
var key:Object = new Object();
key.toString = function() { return "key" }
dict[key] = "Letters";
obj["key"] = "Letters";
dict[key] == "Letters"; // true
obj["key"] == "Letters"; // true
obj[key] == "Letters"; // true because key == "key" is true b/c key.toString == "key"
dict["key"] == "Letters"; // false because "key" === key is false
delete dict[key]; //removes the key
]]>EOFError exception
is thrown. Use the IDataInput.bytesAvailable property to determine
how much data is available to read.
Sign extension matters only when you read data, not when you write it. Therefore you do not need separate
write methods to work with IDataInput.readUnsignedByte() and
IDataInput.readUnsignedShort(). In other words:
IDataOutput.writeByte() with IDataInput.readUnsignedByte() and
IDataInput.readByte().IDataOutput.writeShort() with IDataInput.readUnsignedShort() and
IDataInput.readShort().bytes parameter, starting at
the position specified by offset.
]]>false otherwise.
]]>false otherwise.
]]>
"cn-gb",
"iso-8859-1", and others.
For a complete list, see Supported Character Sets.
Note: If the value for the charSet parameter is not recognized by the current system, then Flash Player uses the system's default code page as the character set. For example, a value for the charSet parameter, as in myTest.readMultiByte(22, "iso-8859-01") that uses 01 instead of 1 might work on your development machine, but not on another machine. On the other machine, Flash Player will use the system's default code page.
readUTF()
method in the Java IDataInput interface.
]]>A stream using the bigEndian byte order (the most significant byte first) writes:
12 34 56 78]]>
A stream using the littleEndian byte order (the least significant byte first) writes:
78 56 34 12]]>
readExternal() methods of the IExternalizable interface are implemented by a class to allow customization
of the contents and format of the data stream (but not the classname or type) for an object and its supertypes.
Each individual class must serialize and reconstruct the state of its instances. These methods must be symmetrical with
the supertype to save its state. These methods supercede the native Action Message Format (AMF) serialization behavior.
If a class does not implement, nor inherits from a class which implements, the IExternalizable interface, then an instance of the class will be serialized using the default mechanism of public members only. As a result, private, internal, and protected members of a class will not be available.
To serialize private members, a class must use the IExternalizable interface. For example, the following class will not serialize any of its members because they are private:
However, if you implement the IExternalizable interface, you can write to, and read from, the data stream the private members of the class as follows:
Note: If a class implements IExternalizable the default serialization no longer applies to instances of that class. If that class inherits public members from a super class, you must carefully manage those members as well.
When a subclass of a class implementing IExternalizable has private members of its own, the subclass must override the methods of IExternalizable, as follows:
The IExternalizable interface can also be used to compress data before writing it to a data stream. For example:
In-memory data is a packed array (the most compact representation for the data type)
of bytes, but an instance of the ByteArray
class can be manipulated with the standard ActionScript [] (array access) operators.
It also can be read and written to as an in-memory file, using
methods similar to those in the URLStream and Socket classes.
In addition, zlib compression and decompression are supported, as well as Action Message Format (AMF) object serialization.
Possible uses of the ByteArray class include the following:
bytes,
starting offset(zero-based index) bytes
into the byte stream.]]>bytes parameter,
and the bytes are written into the destination ByteArray starting at the position specified by offset.
]]>bytes,
starting offset (zero-based index) bytes
into the byte stream.
If the length parameter is omitted, the default
length of 0 is used; Flash Player writes the entire buffer starting at
offset.
If the offset parameter is also omitted, the entire buffer is
written.
If offset or length
is out of range, they are clamped to the beginning and end
of the bytes array.
bytes,
starting offset (zero-based index) bytes
into the byte stream.]]>true or 0 if false.
]]>false, Flash Player writes a 0.
]]>"cn-gb", "iso-8859-1", and others.
For a complete list, see Supported Character Sets.
]]>writeUTFBytes() does not prefix the string with a 16-bit length word.
]]>false otherwise.
]]>false otherwise.
]]>
"cn-gb",
"iso-8859-1", and others.
For a complete list, see Supported Character Sets.
Note: If the value for the charSet parameter is not recognized by the current system, then Flash Player uses the system's default code page as the character set. For example, a value for the charSet parameter, as in myTest.readMultiByte(22, "iso-8859-01") that uses 01 instead of 1 might work on your development machine, but not on another machine. On the other machine, Flash Player will use the system's default code page.
length property of the ByteArray is set to the new length.
The position property is set to the end of the byte array.
The zlib compressed data format is described at http://www.ietf.org/rfc/rfc1950.txt.
]]>length property of the ByteArray is set to the new length.
The position property is set to 0.
The zlib compressed data format is described at http://www.ietf.org/rfc/rfc1950.txt.
]]>true, the player will treat
the data in the array as being in the current system code page when converting.
]]>If the length is set to a value that is smaller than the current length, the array is truncated.
]]>bytesAvailable property in conjunction
with the read methods each time you access a ByteArray object
to ensure that you are reading valid data.
]]>defaultObjectEncoding property is initialized to ObjectEncoding.AMF3.
When an object is written to or read from binary data, the objectEncoding value
is used to determine whether the ActionScript 3.0, ActionScript2.0, or ActionScript 1.0 format should be used. The value is a
constant from the ObjectEncoding class.
timer event to set up code to be run on the timer interval.
You can create Timer objects to run once or repeat at specified intervals to execute code on a schedule. Depending on the SWF file's framerate or Flash Player's environment (available memory and other factors), Flash Player may dispatch events at slightly offset intervals. For example, if a SWF file is set to play at 10 frames per second [fps], which is 100 millisecond intervals, but your timer is set to fire an event at 80 milliseconds, Flash Player will fire the event close to the 100 millisecond interval. Memory-intensive scripts may also offset the events.
]]>timerComplete event object.
This event has the following properties:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The Timer object that has completed its requests. |
timer event object.
This event has the following properties:
| Property | Value |
|---|---|
bubbles | false |
cancelable | false; there is no default behavior to cancel. |
currentTarget | The object that is actively processing the Event object with an event listener. |
target | The Timer object that has reached its interval. |
repeatCount states.
The timer does not start automatically; you must call the start() method
to start it.
repeatCount states.]]>start() is called,
the timer instance runs for the specified number of repetitions,
as set by the repeatCount value.
]]>stop(), the timer
instance runs for the remaining number of repetitions, as set by the repeatCount property.
]]>repeatCount is set to a total that is the same or less then currentCount
the timer stops and will not fire again.
]]>false.
]]>false.]]>If the value parameter is an instance of a type, the returned XML object includes all the instance properties of that type,
but does not include any static properties. You can check for this condition when you parse the XML object by examining the value of the <type> tag's isStatic attribute, which is false when the value parameter is an instance of a type.
To obtain the static properties of a type, pass the type itself for the value parameter. The returned XML object includes not only the type's static properties, but also all of its instance properties.
The instance properties are nested inside a tag named <factory> to distinguish them from the static properties.
In this case, the isStatic attribute of the <type> tag is true.
Note: If you need only to traverse an object's inheritance hierarchy and do not need the other information provided by describeType(),
use the getQualifiedClassName() and getQualifiedSuperclassName() functions instead.
The following table describes some of the tags and attributes of the XML object generated by describeType():
| Tag | Attribute | Description |
|---|---|---|
<type> | The root tag of the XML object. | |
| name | The name of the ActionScript object's data type. | |
| base | The immediate superclass of the ActionScript object's defining class. If the ActionScript object is a class object, the value is Class. | |
| isDynamic | true if the ActionScript object's defining class is dynamic; false otherwise. If the ActionScript object is a class object, the value is true because the Class class is dynamic. | |
| isFinal | true if the ActionScript object's defining class is final; false otherwise. | |
| isStatic | true if the ActionScript object is a class object or constructor function; false otherwise. This attribute is named isStatic because if it is true, any tags that are not nested inside the factory tag are static. | |
<extendsClass> | There is a separate extendsClass tag for each superclass of the ActionScript object's defining class. | |
| type | The name of a superclass that the ActionScript object's defining class extends. | |
<implementsInterface> | There is a separate implementsInterface tag for each interface implemented by the ActionScript object's defining class or any of its superclasses. | |
| type | The name of an interface that the ActionScript object's defining class implements. | |
<accessor> | An accessor is a property defined by getter and setter functions. | |
| name | The name of the accessor. | |
| access | The access rights of the property. Possible values include readonly, writeonly, and readwrite. | |
| type | The data type of the property. | |
| declaredBy | The class that contains the associated getter or setter functions. | |
<constant> | A constant is a property defined with the const statement. | |
| name | The name of the constant. | |
| type | The data type of the constant. | |
<method> | A method is a function declared as part of a class definition. | |
| name | The name of the method. | |
| declaredBy | The class that contains the method definition. | |
| returnType | The data type of the method's return value. | |
<parameter> | There is a separate parameter tag for each parameter that a method defines. This tag is always nested inside a <method> tag. | |
| index | A number corresponding to the order in which the parameter appears in the method's parameter list. The first parameter has a value of 1. | |
| type | The data type of the parameter. | |
| optional | true if the parameter is optional; false otherwise. | |
<variable> | A variable is a property defined with the var statement. | |
| name | The name of the variable. | |
| type | The data type of the variable. | |
<factory> | If the ActionScript object is a class object or constructor function, all instance properties and methods are nested inside this tag. If the isStatic attribute of the <type> tag is true, all properties and methods that are not nested within the <factory> tag are static. This tag appears only if the ActionScript object is a class object or constructor function. |
Note: describeType() only shows public properties and methods, and will not show
properties and methods that are private, package internal or in custom namespaces.
describeType(), but also
doesn't provide all the information describeType() does.
After you retrieve the name of a class with this function, you can convert the class name to a class reference with the getDefinitionByName() function.
Note: This function restricts itself to instance hierarchies, whereas the describeType() function
uses class object hierarchies if the value parameter is a data type. Calling describeType() on a data type returns the
superclass based on the class object hierarchy, in which all class objects inherit from Class. The getQualifiedSuperclassName()
function, however, ignores the class object hierarchy and returns the superclass based on the more familiar instance hierarchy.
For example, calling getQualifiedSuperclassName(String)
returns Object although technically the String class object inherits from Class. In other words, the results are
the same whether you use an instance of a type or the type itself.
false, the escaped string is encoded in UTF-8.
For example, the input string "Crüe" will be escaped as "Cr%C3%BCe" on all systems if System.useCodePage is false.
If system.useCodePage is true, and the system uses a Latin code page, "Crüe" will be escaped as "Cr%FCe".
If the system uses a non Latin code page that does not contain the letter 'ü' the result will probably be "Cr?e".
]]>
false, the escaped string is decoded from UTF-8.
For example, if the input string is "Cr%C3%BCe" and System.useCodePage is false, the result will be "Crüe" on all systems.
If System.useCodePage is true and the input string is "Cr%FCe", and the system uses a Latin code page, the result will also be "Crüe".
Unescaping "Cr%C3%BCe" with System.useCodePage set to true will produce different undesired results on different systems, such as "Crüe" on a Latin system.
Similarly, unescaping "Cr%FCe" with System.useCodePage set to false could produce "Cre" or "Cr?e" or other variations depending on the code page of the system.
]]>
setInterval() method, consider
creating a Timer object, with the specified interval, using 0 as the repeatCount
parameter (which sets the timer to repeat indefinitely).
If you intend to use the clearInterval() method to cancel the
setInterval() call, be sure to assign the setInterval() call to a
variable (which the setInterval() method will later reference), as in the
following:
functionName() or functionName(param).
]]>repeatCount
parameter (which sets the timer to run only once).
If you intend to use the clearTimeout() method to cancel the
setTimeout() call, be sure to assign the setTimeout() call to a
variable (which the clearTimeout() method will later reference)
functionName() or functionName(param).
]]>easeIn() and easeOut() methods
to start the bounce motion slowly, accelerate motion, then decelerate.
]]>easeIn() and easeOut() methods
to start the bounce motion slowly, accelerate motion, then decelerate.]]>easeOut and so on,
are provided in the interest of polymorphism.
]]>easeIn() and easeOut() methods
to start the motion by backtracking, then reversing direction and
moving toward the target, overshooting the target slightly, reversing
direction again, and then moving back toward the target.
]]>easeIn() and easeOut() methods
to start the motion by backtracking, then reversing direction and
moving toward the target, overshooting the target slightly, reversing
direction again, and then moving back toward the target.]]>