Adobe FLEX 2 - CREATING AND EXTENDING COMPONENTS Manual page 138

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

Advertisement

The following example uses this component in an application:
<?xml version="1.0"?>
<!-- as/MainHBoxWithAlert.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:MyComp="myComponents.*">
<mx:Script>
<![CDATA[
import mx.controls.Button;
public function addButton():void {
var myButton:Button = new Button();
myButton.label = "New Button";
myHBox.addChild(myButton);
}
]]>
</mx:Script>
<MyComp:HBoxWithAlert id="myHBox">
</MyComp:HBoxWithAlert>
<mx:Button label="Add Button" click="addButton();"/>
</mx:Application>
138
Creating Simple Visual Components in ActionScript

Advertisement

Table of Contents
loading

Table of Contents