jan_flanders

Untitled

Jun 16th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import flash.display.MovieClip;
  2. import flash.Lib;
  3.  
  4. class MyClass
  5. {
  6.     public var names:Array<String>;
  7.  
  8.     public function new ()
  9.     {
  10.         names = ["ted", "fred", "tim"];
  11.     }
  12.    
  13.     public function iterator ()
  14.     {
  15.         return names.iterator();
  16.     }  
  17. }
  18.  
  19. class Main extends MovieClip
  20. {
  21.     public function new()
  22.     {
  23.         super();
  24.         trace(haxe.Json.stringify(new MyClass()));
  25.         //FP11 JSON: Main.hx:37: {"names":["ted","fred","tim"]}
  26.         //haxe.Json: Main.hx:37: ["ted","fred","tim"]
  27.     }
  28.     public static function main()
  29.     {
  30.         Lib.current.addChild(new Main());
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment