Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 102

Creating and extending flex 2 components
Hide thumbs Also See for FLEX 2 - CREATING AND EXTENDING COMPONENTS:
Table of Contents

Advertisement

You can also use the
parentDocument
document chain of a Flex application. The
components from the UIComponent class. For an MXML component, the
property references the Object corresponding to the component that referenced the MXML
component.
For more information on the
the
parentDocument
page
571, in Flex 2 Developer's Guide.
Even if the calling file does not pass a reference to the Application object, you can always
access it from your MXML component. For example, the following application contains a
custom component called StateComboBoxDirectRef. In this example,
StateComboBoxDirectRef is designed to write the index of the selected item in the
ComboBox to the TextArea control:
<?xml version="1.0"?>
<!-- mxmlAdvanced/MainDirectRef.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComp="myComponents.*">
<mx:TextArea id="myTAMain"/>
<MyComp:StateComboBoxDirectRef/>
</mx:Application>
102
Creating Advanced MXML Components
property to reference the next object up in the
mx.core.Application.application
property, see
Chapter 14, "Using the Application Container," on
property is inherited by all
parentDocument
parentDocument
static property and the

Advertisement

Table of Contents
loading

Table of Contents