Flash CS3 Documentation |
|||
| ActionScript 2.0 Components Language Reference > Data binding classes > DataType.getAnyTypedValue() | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
dataTypeObject.getAnyTypedValue(suggestedTypes)
suggestedTypes An array of strings that specify, in descending order of desirability, the preferred data types for the field.
The current value of the field, in the form of one of the data types specified in the suggestedTypes array.
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.
This example attempts to get the value of a field (productInfo.available) in an XMLConnector component's results property first as a number or, if that fails, as a string.
import mx.data.binding.DataType;
import mx.data.binding.TypedValue;
var f: DataType = myXmlConnector.getField("results", "productInfo.available");
var b: TypedValue = f.getAnyTypedValue(["Number", "String"]);
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002694.html