Flex 监听事件
代码如下:<?xmlversion="1.0"encoding="utf-8"?><mx:WindowedApplicationxmlns:mx="http://www....
代码如下:<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function init():void{
//this.addEventListener('abc',bb);
}
private function bb(e:Event):void{
Alert.show('bbbb');
}
]]>
</mx:Script>
<local:aa abc='bb'/>
</mx:WindowedApplication>
package
{
import flash.events.Event;
import flash.events.IEventDispatcher;
import mx.core.UIComponent;
[Event(name='abc')]
public class aa extends UIComponent
{
public function aa()
{
super();
var e:Event=new Event('abc',true);
this.dispatchEvent(e);
}
}
}
监听不到事件百思不得其解? 展开
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function init():void{
//this.addEventListener('abc',bb);
}
private function bb(e:Event):void{
Alert.show('bbbb');
}
]]>
</mx:Script>
<local:aa abc='bb'/>
</mx:WindowedApplication>
package
{
import flash.events.Event;
import flash.events.IEventDispatcher;
import mx.core.UIComponent;
[Event(name='abc')]
public class aa extends UIComponent
{
public function aa()
{
super();
var e:Event=new Event('abc',true);
this.dispatchEvent(e);
}
}
}
监听不到事件百思不得其解? 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询