通过字符串名访问变量

public class VPP{

        public static var G:String = "AB";
        public var m:String = "A";
        public function VPP() {}
}

 

var v:VPP = new VPP();

trace(v["m"]);//A
trace(VPP["G"]);//AB

posted @ 2013-05-04 11:47  晨祷  阅读(260)  评论(3编辑  收藏  举报