Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.display.MovieClip;
- import flash.Lib;
- class MyClass
- {
- public var names:Array<String>;
- public function new ()
- {
- names = ["ted", "fred", "tim"];
- }
- public function iterator ()
- {
- return names.iterator();
- }
- }
- class Main extends MovieClip
- {
- public function new()
- {
- super();
- trace(haxe.Json.stringify(new MyClass()));
- //FP11 JSON: Main.hx:37: {"names":["ted","fred","tim"]}
- //haxe.Json: Main.hx:37: ["ted","fred","tim"]
- }
- public static function main()
- {
- Lib.current.addChild(new Main());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment