Posted By

martijnbleyen on 07/02/10


Tagged

objecttrace


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Vordreller


Object trace with output trace


 / Published in: ActionScript 3
 

  1. var obj:Object = {age:19, name:"Martijn" ,country:"Belgium",location:"Lommel",zipCode:3920};
  2. traceObject(obj);
  3.  
  4. private function traceObject(o:Object):void{
  5. trace('\n');
  6. for(var val:* in o){
  7. trace(' [' + typeof(o[val]) + '] ' + val + ' => ' + o[val]);
  8. }
  9. }
  10.  
  11. // trace output
  12. ///////////////////////////
  13. // [string] name => Martijn
  14. // [string] location => Lommel
  15. // [string] country => Belgium
  16. // [number] zipCode => 3920
  17. // [number] age => 19
  18. ///////////////////////////

Report this snippet  

You need to login to post a comment.