FLEX 动态添加事件

<?xml version="1.0"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

				layout="absolute"

				verticalAlign="middle"

				backgroundColor="white"

				initialize="init()">

	<mx:Script>

		<![CDATA[

			import mx.controls.Alert;

			import mx.events.CloseEvent;

			private function init():void

			{

				Ind.addEventListener(Event.CHANGE,Ind_changeHandler);

			}

			protected function Ind_changeHandler(event:Event):void

			{

				Alert.show("Ind");

			}

		]]>

	</mx:Script>

		<mx:RadioButton x="337" y="42" groupName="showModel" label="Individual" id="Ind" selected="true"/>

</mx:Application>


你可能感兴趣的:(Flex)