使用全局事件调度程序的缺点是什么,如下所述: http ://www.riaspace.com/2010/11/unframework-so-how-to-getaway-without-any-framework/ 请 记住,我只从事小型(ish)应用程序。
// eventDispatcher.as script file
package
{
import flash.events.IEventDispatcher;
public function get eventDispatcher():IEventDispatcher
{
return _eventDispatcher;
}
}
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
var _eventDispatcher:IEventDispatcher = new EventDispatcher();
public class MyViewPM
{
public function btn_clickHandler():void
{
eventDispatcher.dispatchEvent(new MyEvent(MyEvent.EVENT_TYPE));
}
}