You can also use the methods of the DataType class to get or set fields in various data types. The
DataType class automatically converts the raw data to the requested type, if possible. For example,
in the code example above, the data that's retrieved is converted to the String type, even if the raw
data is a different type.
The
ComponentMixins.getField()
included in a data binding (either as a source, destination, or an index), or that have been
initialized with
ComponentMixins.initComponent()
"ComponentMixins class (Flash Professional only)" on page
Note: To make this class available at runtime, you must include the data binding classes in your FLA
document.
For an overview of the classes in the mx.data.binding package, see
package (Flash Professional only)" on page
Method summary for the DataType class
The following table lists the methods of the DataType class.
Method
DataType.getAnyTypedValue()
DataType.getAsBoolean()
DataType.getAsNumber()
DataType.getAsString()
DataType.getTypedValue()
DataType.setAnyTypedValue()
DataType.setAsBoolean()
DataType.setAsNumber()
DataType.setAsString()
DataType.setTypedValue()
Property summary for the DataType class
The following table lists the properties of the DataType class.
Property
DataType.encoder
DataType.formatter
DataType.kind
method is available for components that have been
213.
Description
Fetches the current value of the field.
Fetches the current value of the field as a Boolean value.
Fetches the current value of the field as a number.
Fetches the current value of the field as a String value.
Fetches the current value of the field in the form of the requested
data type.
Sets a new value in the field.
Sets the field to the new value, which is given as a Boolean value.
Sets the field to the new value, which is given as a number.
Sets the field to the new value, which is given as a string.
Sets a new value in the field.
Description
Provides a reference to the encoder object associated with this field.
Provides a reference to the formatter object associated with
this field.
Provides a reference to the Kind object associated with this field.
Data binding classes (Flash Professional only)
. For more information, see
229.
"Classes in the mx.data.binding
235
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?