Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 103

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

Advertisement

The simplest way to write StateComboBoxDirectRef.mxml is to use the
mx.core.Application.application
TextArea
control, as the following example shows:
<?xml version="1.0"?>
<!-- mxmlAdvanced/myComponents/StateComboBoxDirectRef.mxml -->
<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml"
close="handleCloseEvent(event);">
<mx:Script>
<![CDATA[
import flash.events.Event;
import mx.core.Application;
public function handleCloseEvent(eventObj:Event):void {
mx.core.Application.application.myTAMain.text=
}
]]>
</mx:Script>
<mx:dataProvider>
<mx:String>AK</mx:String>
<mx:String>AL</mx:String>
</mx:dataProvider>
</mx:ComboBox>
In the previous example, you use the
directly to the TextArea control in the main application. You must cast the
selectedIndex
value of
selectedIndex
type String.
static property to write the index directly to the
String(this.selectedIndex);
event of the
close
to a String because the
Adding custom properties and methods to a component
ComboBox
control to write the
property of the TextArea control is of
text
103

Advertisement

Table of Contents
loading

Table of Contents