User Guide
Data binding classes (Flash Professional only) 237
For more information about the formatters provided with Flash MX Professional 2004, see
“Schema formatters” in Using Flash.
Example
This example assumes that the field being accessed is using the Number Formatter
(mx.data.formatters.NumberFormatter) provided with Flash MX Professional 2004. This
formatter contains a property named
precision that specifies how many digits to display after
the decimal point. This code sets the
precision property to two decimal places for a field using
this formatter.
var myField:DataType = dataGrid.getField("currentBalance");
myField.formatter.precision = 2;
DataType.getAnyTypedValue()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
dataTypeObject.getAnyTypedValue(suggestedTypes)
Parameters
suggestedTypes
An array of strings that specify, in descending order of desirability, the
preferred data types for the field.
Returns
The current value of the field, in the form of one of the data types specified in the
suggestedTypes array.
Description
Method; fetches the current value of the field, using the information in the field’s schema to
process the value. If the field can provide a value as the first data type specified in the
suggestedTypes array, the method returns the field’s value as that data type. If not, the method
attempts to extract the field’s value as the second data type specified in the
suggestedTypes array,
and so on.
If you specify
null as one of the items in the suggestedTypes array, the method returns the
value of the field in the data type specified in the Schema tab of the Component inspector.
Specifying
null always results in a value being returned, so only use null at the end of the array.
If a value can’t be returned in the form of the one of the suggested types, it is returned in the type
specified in the Schema tab.