dispatch

ViewerContainer.getInstance().addEventListener("LoadedOver", function(evt:Event):void
{
ViewerContainer.getInstance().dispatchEvent(new AppEvent("SetData", obj));
});
ViewerContainer.getInstance().widgetManager.loadWidgetByName("TabWidget");


2.

ViewerContainer.getInstance().addEventListener("SetData", function(evt:AppEvent):void
{
str=evt.data.type;
sql=evt.data.str;
});
ViewerContainer.getInstance().dispatchEvent(new Event("LoadedOver"));

 3、

AppEvent.addListener(AppEvent.WIDGET_STATE_CHANGED, widgetStateChangedHandler);

 

private function widgetStateChangedHandler(event:AppEvent):void
{
var data:Object = event.data;

}

 

AppEvent.dispatch(AppEvent.WIDGET_RUN, data.id);

 

 

                       

你可能感兴趣的:(Dispatch)