婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > Flex 事件分發(fā)(FlexViewer事件機制)剝離過程

Flex 事件分發(fā)(FlexViewer事件機制)剝離過程

熱門標(biāo)簽:廣州ai外呼系統(tǒng)業(yè)務(wù) 車載電話機器人 什么行業(yè)需要電話機器人 天津企業(yè)外呼系統(tǒng)代理商 無錫電銷外呼系統(tǒng)代理 中山外呼系統(tǒng)中間件 外呼系統(tǒng)號碼顯示 南昌crm外呼系統(tǒng)如何 地圖標(biāo)注多家店

將FlexViewer里面的事件分發(fā)及監(jiān)聽事件機制剝離出來在其他項目中使用

AppEvent.as

package com 
{ 
import flash.events.Event; 

/** 
* @author SamSung 
* 創(chuàng)建時間:2014-7-24 下午1:21:05 
* 
*/ 
public class AppEvent extends Event 
{ 
//-------------------------------------------------------------------------- 
// 
// Properties 
// 
//-------------------------------------------------------------------------- 

private var _data:Object; 

private var _callback:Function; 

public function AppEvent(type:String, data:Object = null, callback:Function = null) 
{ 
super(type); 
_data = data; 
_callback = callback; 
} 


/** 
* The data will be passed via the event. It allows the event dispatcher to publish 
* data to event listener(s). 
*/ 
public function get data():Object 
{ 
return _data; 
} 

/** 
* @private 
*/ 
public function set data(value:Object):void 
{ 
_data = value; 
} 

/** 
* The callback function associated with this event. 
*/ 
public function get callback():Function 
{ 
return _callback; 
} 

/** 
* @private 
*/ 
public function set callback(value:Function):void 
{ 
_callback = value; 
} 

/** 
* Override clone 
*/ 
public override function clone():Event 
{ 
return new AppEvent(this.type, this.data, this.callback); 
} 

/** 
* Dispatch this event. 
*/ 
public function dispatch():Boolean 
{ 
return EventBus.instance.dispatchEvent(this); 
} 

/** 
* Dispatch an AppEvent for specified type and with optional data and callback reference. 
*/ 
public static function dispatch(type:String, data:Object = null, callback:Function = null):Boolean 
{ 
return EventBus.instance.dispatchEvent(new AppEvent(type, data, callback)); 
} 

public static function addListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void 
{ 
EventBus.instance.addEventListener(type, listener, useCapture, priority, useWeakReference); 
} 

public static function removeListener(type:String, listener:Function, useCapture:Boolean = false):void 
{ 
EventBus.instance.removeEventListener(type, listener, useCapture); 
} 

} 
}

EventBus.as

package com 
{ 
import flash.events.Event; 
import flash.events.EventDispatcher; 

/** 
* The EventBus allows centrallized communication among modules without 
* point-to-point messaging. It uses the singleton design pattern 
* to make sure one event bus is available globally. The bus itself 
* is only available to the container. Modules use the container's 
* static method to communicate with the event bus. 
*/ 
public class EventBus extends EventDispatcher 
{ 
/** Application event bus instance */ 
public static const instance:EventBus = new EventBus(); 

/** 
* Normally the EventBus is not instantiated via the b>new/b> method directly. 
* The constructor helps enforce only one EvenBus availiable for the application 
* (singeton) so that it asures the communication only via a sigle event bus. 
*/ 
public function EventBus() 
{ 
} 

/** 
* The factory method is used to create a instance of the EventBus. It returns 
* the only instanace of EventBus and makes sure no another instance is created. 
*/ 
[Deprecated(replacement="instance")] 
public static function getInstance():EventBus 
{ 
return instance; 
} 

/** 
* Basic dispatch function, dispatches simple named events. In the case 
* that the event is only significant by the event token (type string), 
* this new dispatch method simplify the code. 
*/ 
[Deprecated(replacement="AppEvent.dispatch")] 
public function dispatch(type:String):Boolean 
{ 
return dispatchEvent(new Event(type)); 
} 
} 
}
您可能感興趣的文章:
  • 詳解Android事件的分發(fā)、攔截和執(zhí)行
  • Android View 事件分發(fā)機制詳解
  • Android 事件分發(fā)詳解及示例代碼
  • Android事件的分發(fā)機制詳解
  • Android Touch事件分發(fā)深入了解
  • 30分鐘搞清楚Android Touch事件分發(fā)機制
  • Android Touch事件分發(fā)過程詳解
  • java隨機事件分發(fā)器示例
  • Android View事件分發(fā)機制詳解

標(biāo)簽:呂梁 仙桃 海西 欽州 滄州 佛山 泰州 攀枝花

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Flex 事件分發(fā)(FlexViewer事件機制)剝離過程》,本文關(guān)鍵詞  Flex,事件,分發(fā),FlexViewer,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Flex 事件分發(fā)(FlexViewer事件機制)剝離過程》相關(guān)的同類信息!
  • 本頁收集關(guān)于Flex 事件分發(fā)(FlexViewer事件機制)剝離過程的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 崇信县| 阳山县| 苏州市| 温宿县| 桃江县| 常熟市| 广丰县| 博湖县| 二连浩特市| 拜城县| 瓦房店市| 双流县| 来宾市| 南安市| 黑山县| 锡林郭勒盟| 鹤庆县| 邹城市| 靖安县| 嫩江县| 腾冲县| 英超| 同江市| 涞水县| 沙洋县| 隆子县| 广灵县| 临江市| 山西省| 白水县| 花垣县| 景泰县| 鄂尔多斯市| 谷城县| 晋江市| 毕节市| 河南省| 长武县| 朝阳区| 嘉祥县| 昌邑市|