Posted By

alexaivars on 10/01/09


Tagged

class toString describeType


Versions (?)

Lazy CLASS toString


 / Published in: ActionScript 3
 

  1. public function toString():String
  2. {
  3. var xml:XML = describeType(this);
  4. var list:XMLList = xml..accessor.( attribute("access") == "readwrite" || attribute("access") == "readonly")
  5. var key:String;
  6. var values:Array = [];
  7. for each( var item:XML in list)
  8. {
  9. key = item.attribute("name").toString();
  10. values.push(key + "=" + this[key]);
  11. }
  12. return xml.attribute("name").toString().split("::")[1] + "[ " + values.join(", ") + " ]";
  13. }

Report this snippet  

You need to login to post a comment.