且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取 as3 中变量名的字符串表示形式

更新时间:2023-11-02 23:00:46

希望这会有所帮助.

class A {
   var dog:String = "something";
   var cat:String = "eatdog";
}

function getVars(obj:*):void
{
    for(var i:* in obj){
        trace( i + " : " + obj[i]);
        // this will trace all properties of object.
        // dog : somthing
        // cat : eatdog
    }
}