4、Flex3自定义事件、事件冒泡及传值、组件间的函数回调及传值
为了演示事件冒泡,demo写的可能有点繁琐。大家凑合看看。
1.project结构
?
2、主文件
?3、WorkSpace.as
?4、弹出窗口SongList.mxml
?5、自定义事件、这里的属性最好写成private类型,再加上set、get方法。我这里写的是public 的
package com.future.event{import flash.events.Event;public class SelectSongEvent extends Event{public static const SELECT_SONG:String = "select song";public var selectedSong:String;public function SelectSongEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false){super(type, bubbles, cancelable);}}}?