/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function toString():String { var xml:XML = describeType(this); var list:XMLList = xml..accessor.( attribute("access") == "readwrite" || attribute("access") == "readonly") var key:String; var values:Array = []; for each( var item:XML in list) { key = item.attribute("name").toString(); values.push(key + "=" + this[key]); } return xml.attribute("name").toString().split("::")[1] + "[ " + values.join(", ") + " ]"; }