【发布时间】:2012-08-22 05:11:17
【问题描述】:
很抱歉这个蹩脚的问题,但我不知道如何搜索它。因此,如果我有两个来自同一班级的事件,例如:
package {
import flash.events.Event;
public class StylingEvent extends Event{
public static const BLUE_BG:String = "blue_bg";
public static const GREEN_BG:String = "green_bg";
public function StylingEvent(type:String) {
super(type);
}
}}
我是否需要添加两个事件监听器,例如:
gameData.addEventListener(StylingEvent.BLUE_BG, onChangeBg);
gameData.addEventListener(StylingEvent.GREEN_BG, onChangeBg);
或者有没有可能:
gameData.addEventListener( [any type of stylingEvent] , [some method]);
谢谢
【问题讨论】:
-
别忘了你也应该重写克隆功能 - 见*.com/questions/3585638/…
-
这很酷,谢谢,但是我现在没有写,因为我只使用类常量,而且代码中有很多 $ 和其他奇怪的符号,所以我不想要现在就明白了
标签: actionscript-3 flash class events actionscript