You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
name="DemoApplication"
backgroundColor="#FFFFFF"
backgroundAlpha="0"
creationComplete="initApp()"
>
<mx:Script>
<![CDATA[
import flash.events.EventPhase
import mx.controls.Alert;
private function initApp():void {
myVBox2.addEventListener("click", myHandleClick);
myVBox3.addEventListener("click", myHandleClick2);
}
private function myHandleClick(event:Event):void {
label1.text = "You clicked VBox 2";
}
private function myHandleClick2(event:Event):void {
myVBox2.removeEventListener("click",myHandleClick);
label1.text = "";
}
]]>
</mx:Script>
<mx:Label text="Application"/>
<mx:VBox id="myVBox1"
backgroundColor="#FFCCFF"
width="300" height="100"
horizontalAlign="center">
<mx:Label text="VBox 1" />
</mx:VBox>
<mx:VBox id="myVBox2"
backgroundColor="#FFCCCC"
width="300" height="100"
horizontalAlign="center">
<mx:Label text="VBox 2" />
</mx:VBox>
<mx:VBox id="myVBox3"
backgroundColor="#FFFFCC"
width="300" height="100"
horizontalAlign="center">
<mx:Label text="VBox 3" />
</mx:VBox>
<mx:Label id="label1"
width="80%" height="48"
fontWeight="bold" />
</mx:Application>