User Guide
230 Chapter 6: Components Dictionary
ComponentMixins.getField()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
componentInstance.getField(propertyName, [location])
Parameters
propertyName
A string that contains the name of a property of the specified component.
location An optional parameter that indicates the location of a field within the component
property. This is useful if
propertyName specifies a complex data structure and you are interested
in a particular field of that structure. The
location property can take one of three forms:
• A string that contains an XPath expression. This is only valid for XML data structures. For a
list of supported XPath expressions, see “Adding bindings using path expressions” in Using
Flash.
• A string that contains field names, separated by dots—for example, "a.b.c". This form is
permitted for any complex data (ActionScript or XML).
• An array of strings, where each string is a field name—for example, ["a", "b", "c"]. This
form is permitted for any complex data (ActionScript or XML).
Returns
A DataType object.
Description
Method; returns a DataType object whose methods you can use to get or set the data value in the
component property at the specified field location. For more information, see “DataType class
(Flash Professional only)” on page 234.
Example
This example uses the DataType.setAsString() method to set the value of a field located in a
component’s property. In this case the property (
results) is a complex data structure.
import mx.data.binding.*;
var field : DataType = myComponent.getField("results", "po.address.name1");
field.setAsString("Teri Randall");
See also
DataType.setAsString()