如何列出在類中定義的公共(和私有/受保護)const的所有名稱(和值)?如何列出類中定義的所有常量屬性
public class Layers {
public const BACKGROUND:String = "background";
public const PARENT:String = "parent";
public const MAP:String = "map";
public const LINES:String = "lines";
public const POINTS:String = "points";
public const WINDOWS:String = "windows";
...
public function isValidValue(type:String) {
// ...
// if type is a value of a constant return TRUE
// ...
}
}
哇!一個數組肯定會更快!但是閱讀類定義我確信我不會忘記在兩個地方更新值。謝謝。 – yuri 2010-10-06 16:06:53