flex4事件1
1.创建事件类
package xx.cloudstudio.xx.events{import flash.events.Event;public class StorageEvent extends Event{public var storageRequest:StorageRequest;public static const EVENETNAME:String = "storageEvent";public function StorageEvent(type:String, bubbles:Boolean,storageRequest:StorageRequest){super(type, bubbles);this.storageRequest = storageRequest;}}}
?2.自定义组件分发事件
??? ??? ??? ??? var? storageEvent:StorageEvent = new StorageEvent(StorageEvent.EVENETNAME,true,storageRequest);
??? ??? ??? ???
??? ??? ??? ???
??? ??? ??? ??? this.dispatchEvent(storageEvent);
?
3.事件是由this分发,添加this的事件监听
storageWindow.addEventListener(StorageEvent.EVENETNAME,addStorageHandler);