2010-05-07 62 views
0

比方說,我們有下面的類在ActionScript3中運行時,有沒有辦法從類中獲取所有靜態成員的名單

public class PlayerEvent extends Event 
{ 
    public static const PLAYER_INIT:String = "playerInit"; 
    public static const PLAYER_MOVE:String = "playerMove"; 
    public static const PLAYER_USE_SKILL:String = "playerUseSkill"; 

    public function PlayerEvent(type:String) 
    { 
     super(type, false, true); 
    } 
} 

} 

在Flash Player運行時,有沒有一種方法可以讓我得到的名單lass PlayerEvent的所有靜態成員。

喜歡的東西:

trace(PlayerEvent.staticMethods) // ["PLAYER_INIT", "PLAYER_MOVE", "PLAYER_USE_SKILL"]... 

回答

相關問題