Browse Source

remove flash8 target (see #3922)

Dan Korostelev 10 years ago
parent
commit
7eeeed0b33
100 changed files with 166 additions and 4611 deletions
  1. 3 5
      Makefile
  2. 1 1
      analyzer.ml
  3. 0 20
      common.ml
  4. 2 0
      extra/CHANGES.txt
  5. 0 4
      extra/ImportAll.hx
  6. 0 7
      extra/all.hxml
  7. 1 1
      extra/release.neko
  8. 2 2
      filters.ml
  9. 3 35
      genswf.ml
  10. 0 1590
      genswf8.ml
  11. 11 1
      genswf9.ml
  12. 16 26
      main.ml
  13. 1 17
      std/Date.hx
  14. 4 10
      std/Math.hx
  15. 1 1
      std/StdTypes.hx
  16. 5 13
      std/StringTools.hx
  17. 3 3
      std/UInt.hx
  18. 0 13
      std/flash8/Accessibility.hx
  19. 0 334
      std/flash8/Boot.hx
  20. 0 58
      std/flash8/Button.hx
  21. 0 42
      std/flash8/Camera.hx
  22. 0 35
      std/flash8/Color.hx
  23. 0 15
      std/flash8/ContextMenu.hx
  24. 0 18
      std/flash8/ContextMenuItem.hx
  25. 0 29
      std/flash8/ExtendedKey.hx
  26. 0 58
      std/flash8/Key.hx
  27. 0 74
      std/flash8/Lib.hx
  28. 0 34
      std/flash8/LoadVars.hx
  29. 0 20
      std/flash8/LocalConnection.hx
  30. 0 31
      std/flash8/Microphone.hx
  31. 0 33
      std/flash8/Mouse.hx
  32. 0 181
      std/flash8/MovieClip.hx
  33. 0 46
      std/flash8/MovieClipLoader.hx
  34. 0 21
      std/flash8/NetConnection.hx
  35. 0 39
      std/flash8/NetStream.hx
  36. 0 20
      std/flash8/PrintJob.hx
  37. 0 22
      std/flash8/Selection.hx
  38. 0 45
      std/flash8/SharedObject.hx
  39. 0 35
      std/flash8/Sound.hx
  40. 0 28
      std/flash8/Stage.hx
  41. 0 15
      std/flash8/System.hx
  42. 0 93
      std/flash8/TextField.hx
  43. 0 40
      std/flash8/TextFormat.hx
  44. 0 18
      std/flash8/TextSnapshot.hx
  45. 0 30
      std/flash8/Video.hx
  46. 0 19
      std/flash8/XMLRequest.hx
  47. 0 18
      std/flash8/XMLSocket.hx
  48. 0 118
      std/flash8/_std/Reflect.hx
  49. 0 77
      std/flash8/_std/Std.hx
  50. 0 208
      std/flash8/_std/Type.hx
  51. 0 81
      std/flash8/_std/haxe/ds/IntMap.hx
  52. 0 102
      std/flash8/_std/haxe/ds/ObjectMap.hx
  53. 0 79
      std/flash8/_std/haxe/ds/StringMap.hx
  54. 0 46
      std/flash8/display/BitmapData.hx
  55. 0 10
      std/flash8/external/ExternalInterface.hx
  56. 0 21
      std/flash8/filters/BevelFilter.hx
  57. 0 5
      std/flash8/filters/BitmapFilter.hx
  58. 0 12
      std/flash8/filters/BlurFilter.hx
  59. 0 10
      std/flash8/filters/ColorMatrixFilter.hx
  60. 0 18
      std/flash8/filters/ConvolutionFilter.hx
  61. 0 18
      std/flash8/filters/DisplacementMapFilter.hx
  62. 0 20
      std/flash8/filters/DropShadowFilter.hx
  63. 0 17
      std/flash8/filters/GlowFilter.hx
  64. 0 20
      std/flash8/filters/GradientBevelFilter.hx
  65. 0 20
      std/flash8/filters/GradientGlowFilter.hx
  66. 0 19
      std/flash8/geom/ColorTransform.hx
  67. 0 30
      std/flash8/geom/Matrix.hx
  68. 0 23
      std/flash8/geom/Point.hx
  69. 0 41
      std/flash8/geom/Rectangle.hx
  70. 0 13
      std/flash8/geom/Transform.hx
  71. 0 23
      std/flash8/net/FileReference.hx
  72. 0 13
      std/flash8/net/FileReferenceList.hx
  73. 0 61
      std/flash8/system/Capabilities.hx
  74. 0 27
      std/flash8/system/IME.hx
  75. 0 17
      std/flash8/system/Security.hx
  76. 0 20
      std/flash8/text/StyleSheet.hx
  77. 0 8
      std/flash8/text/TextRenderer.hx
  78. 4 16
      std/haxe/CallStack.hx
  79. 4 44
      std/haxe/Http.hx
  80. 2 2
      std/haxe/Int32.hx
  81. 1 1
      std/haxe/Log.hx
  82. 10 10
      std/haxe/Serializer.hx
  83. 2 7
      std/haxe/Timer.hx
  84. 2 2
      std/haxe/Unserializer.hx
  85. 2 2
      std/haxe/ds/GenericStack.hx
  86. 1 1
      std/haxe/ds/Vector.hx
  87. 7 7
      std/haxe/format/JsonPrinter.hx
  88. 17 21
      std/haxe/io/Bytes.hx
  89. 12 12
      std/haxe/io/BytesBuffer.hx
  90. 1 1
      std/haxe/io/BytesData.hx
  91. 8 8
      std/haxe/io/BytesInput.hx
  92. 6 6
      std/haxe/io/BytesOutput.hx
  93. 5 5
      std/haxe/io/FPHelper.hx
  94. 0 3
      std/haxe/io/Path.hx
  95. 2 14
      std/haxe/remoting/AMFConnection.hx
  96. 1 9
      std/haxe/remoting/ExternalConnection.hx
  97. 1 5
      std/haxe/remoting/FlashJsConnection.hx
  98. 20 47
      std/haxe/remoting/LocalConnection.hx
  99. 4 8
      std/haxe/remoting/SocketConnection.hx
  100. 1 3
      std/haxe/remoting/SocketProtocol.hx

+ 3 - 5
Makefile

@@ -48,7 +48,7 @@ CC_PARSER_CMD = $(COMPILER) -pp camlp4o $(CFLAGS) -c parser.ml
 RELDIR=../../..
 RELDIR=../../..
 
 
 MODULES=ast type lexer common genxml parser typecore optimizer typeload \
 MODULES=ast type lexer common genxml parser typecore optimizer typeload \
-	codegen gencommon genas3 gencpp genjs genneko genphp genswf8 \
+	codegen gencommon genas3 gencpp genjs genneko genphp \
 	genswf9 genswf genjava gencs genpy interp dce analyzer filters typer matcher version main
 	genswf9 genswf genjava gencs genpy interp dce analyzer filters typer matcher version main
 
 
 ADD_REVISION=0
 ADD_REVISION=0
@@ -144,11 +144,9 @@ genphp.$(MODULE_EXT): type.$(MODULE_EXT) lexer.$(MODULE_EXT) common.$(MODULE_EXT
 
 
 genpy.$(MODULE_EXT): type.$(MODULE_EXT) lexer.$(MODULE_EXT) common.$(MODULE_EXT) codegen.$(MODULE_EXT) ast.$(MODULE_EXT)
 genpy.$(MODULE_EXT): type.$(MODULE_EXT) lexer.$(MODULE_EXT) common.$(MODULE_EXT) codegen.$(MODULE_EXT) ast.$(MODULE_EXT)
 
 
-genswf.$(MODULE_EXT): type.$(MODULE_EXT) genswf9.$(MODULE_EXT) genswf8.$(MODULE_EXT) common.$(MODULE_EXT) ast.$(MODULE_EXT)
+genswf.$(MODULE_EXT): type.$(MODULE_EXT) genswf9.$(MODULE_EXT) common.$(MODULE_EXT) ast.$(MODULE_EXT)
 
 
-genswf8.$(MODULE_EXT): type.$(MODULE_EXT) lexer.$(MODULE_EXT) common.$(MODULE_EXT) codegen.$(MODULE_EXT) ast.$(MODULE_EXT)
-
-genswf9.$(MODULE_EXT): type.$(MODULE_EXT) lexer.$(MODULE_EXT) genswf8.$(MODULE_EXT) common.$(MODULE_EXT) codegen.$(MODULE_EXT) ast.$(MODULE_EXT)
+genswf9.$(MODULE_EXT): type.$(MODULE_EXT) lexer.$(MODULE_EXT) common.$(MODULE_EXT) codegen.$(MODULE_EXT) ast.$(MODULE_EXT)
 
 
 genxml.$(MODULE_EXT): type.$(MODULE_EXT) lexer.$(MODULE_EXT) common.$(MODULE_EXT) ast.$(MODULE_EXT)
 genxml.$(MODULE_EXT): type.$(MODULE_EXT) lexer.$(MODULE_EXT) common.$(MODULE_EXT) ast.$(MODULE_EXT)
 
 

+ 1 - 1
analyzer.ml

@@ -1589,7 +1589,7 @@ module Run = struct
 	let run_on_expr com config is_var_expression e =
 	let run_on_expr com config is_var_expression e =
 		let do_simplify = (not (Common.defined com Define.NoSimplify) ) && match com.platform with
 		let do_simplify = (not (Common.defined com Define.NoSimplify) ) && match com.platform with
 			| Cpp when Common.defined com Define.Cppia -> false
 			| Cpp when Common.defined com Define.Cppia -> false
-			| Cpp | Flash8 | Python -> true
+			| Cpp | Python -> true
 			| _ -> false
 			| _ -> false
 		in
 		in
 		let with_timer s f =
 		let with_timer s f =

+ 0 - 20
common.ml

@@ -49,7 +49,6 @@ type stats = {
 
 
 type platform =
 type platform =
 	| Cross
 	| Cross
-	| Flash8
 	| Js
 	| Js
 	| Neko
 	| Neko
 	| Flash
 	| Flash
@@ -235,7 +234,6 @@ module Define = struct
 		| SwfDebugPassword
 		| SwfDebugPassword
 		| SwfDirectBlit
 		| SwfDirectBlit
 		| SwfGpu
 		| SwfGpu
-		| SwfMark
 		| SwfMetadata
 		| SwfMetadata
 		| SwfPreloaderFrame
 		| SwfPreloaderFrame
 		| SwfProtected
 		| SwfProtected
@@ -321,7 +319,6 @@ module Define = struct
 		| SwfDebugPassword -> ("swf_debug_password", "Set a password for debugging")
 		| SwfDebugPassword -> ("swf_debug_password", "Set a password for debugging")
 		| SwfDirectBlit -> ("swf_direct_blit", "Use hardware acceleration to blit graphics")
 		| SwfDirectBlit -> ("swf_direct_blit", "Use hardware acceleration to blit graphics")
 		| SwfGpu -> ("swf_gpu", "Use GPU compositing features when drawing graphics")
 		| SwfGpu -> ("swf_gpu", "Use GPU compositing features when drawing graphics")
-		| SwfMark -> ("swf_mark","GenSWF8 internal")
 		| SwfMetadata -> ("swf_metadata", "=<file> Include contents of <file> as metadata in the swf")
 		| SwfMetadata -> ("swf_metadata", "=<file> Include contents of <file> as metadata in the swf")
 		| SwfPreloaderFrame -> ("swf_preloader_frame", "Insert empty first frame in swf")
 		| SwfPreloaderFrame -> ("swf_preloader_frame", "Insert empty first frame in swf")
 		| SwfProtected -> ("swf_protected","Compile Haxe private as protected in the SWF instead of public")
 		| SwfProtected -> ("swf_protected","Compile Haxe private as protected in the SWF instead of public")
@@ -555,21 +552,6 @@ let get_config com =
 	match com.platform with
 	match com.platform with
 	| Cross ->
 	| Cross ->
 		default_config
 		default_config
-	| Flash8 ->
-		{
-			pf_static = false;
-			pf_sys = false;
-			pf_locals_scope = com.flash_version > 6.;
-			pf_captured_scope = false;
-			pf_unique_locals = false;
-			pf_capture_policy = CPLoopVars;
-			pf_pad_nulls = false;
-			pf_add_final_return = false;
-			pf_overload = false;
-			pf_pattern_matching = false;
-			pf_can_skip_non_nullable_argument = true;
-			pf_reserved_type_paths = [];
-		}
 	| Js ->
 	| Js ->
 		{
 		{
 			pf_static = false;
 			pf_static = false;
@@ -801,7 +783,6 @@ let file_extension file =
 	| [] -> ""
 	| [] -> ""
 
 
 let platforms = [
 let platforms = [
-	Flash8;
 	Js;
 	Js;
 	Neko;
 	Neko;
 	Flash;
 	Flash;
@@ -814,7 +795,6 @@ let platforms = [
 
 
 let platform_name = function
 let platform_name = function
 	| Cross -> "cross"
 	| Cross -> "cross"
-	| Flash8 -> "flash8"
 	| Js -> "js"
 	| Js -> "js"
 	| Neko -> "neko"
 	| Neko -> "neko"
 	| Flash -> "flash"
 	| Flash -> "flash"

+ 2 - 0
extra/CHANGES.txt

@@ -1,5 +1,7 @@
 2015-03-15: 3.2.0-RC1
 2015-03-15: 3.2.0-RC1
 
 
+	This release removes support for Flash 8 target
+
 	New features:
 	New features:
 
 
 	all : added --display mode for toplevel completion
 	all : added --display mode for toplevel completion

+ 0 - 4
extra/ImportAll.hx

@@ -40,8 +40,6 @@ class ImportAll {
 			if( !Context.defined("js") ) return;
 			if( !Context.defined("js") ) return;
 		case "cpp":
 		case "cpp":
 			if( !Context.defined("cpp") ) return;
 			if( !Context.defined("cpp") ) return;
-		case "flash8":
-			if( !Context.defined("flash") || Context.defined("flash9") ) return;
 		case "flash":
 		case "flash":
 			if( !Context.defined("flash9") ) return;
 			if( !Context.defined("flash9") ) return;
 		case "sys":
 		case "sys":
@@ -74,8 +72,6 @@ class ImportAll {
 				var full = (pack == "") ? file : pack + "." + file;
 				var full = (pack == "") ? file : pack + "." + file;
 				if( StringTools.endsWith(file, ".hx") ) {
 				if( StringTools.endsWith(file, ".hx") ) {
 					var cl = full.substr(0, full.length - 3);
 					var cl = full.substr(0, full.length - 3);
-					if( StringTools.startsWith(cl,"flash8.") )
-						cl = "flash."+cl.substr(7);
 					switch( cl ) {
 					switch( cl ) {
 					case "ImportAll", "neko.db.MacroManager": continue;
 					case "ImportAll", "neko.db.MacroManager": continue;
 					case "haxe.TimerQueue": if( Context.defined("neko") || Context.defined("php") || Context.defined("cpp") ) continue;
 					case "haxe.TimerQueue": if( Context.defined("neko") || Context.defined("php") || Context.defined("cpp") ) continue;

+ 0 - 7
extra/all.hxml

@@ -8,13 +8,6 @@
 
 
 --next
 --next
 
 
--swf all.swf
--swf-version 8
--xml flash8.xml
--D flash_lite
-
---next
-
 -js all.js
 -js all.js
 -xml js.xml
 -xml js.xml
 
 

+ 1 - 1
extra/release.neko

@@ -54,7 +54,7 @@ chdir(dir+"/std/tools");
 
 
 chdir("haxedoc");
 chdir("haxedoc");
 cmd("haxe haxedoc.hxml");
 cmd("haxe haxedoc.hxml");
-cmd(curdir+"haxedoc -v \"../../../../flash8.xml;flash8;flash\" \"../../../../neko.xml;neko\" \"../../../../js.xml;js\" \"../../../../flash9.xml;flash\" \"../../../../php.xml;php\" \"../../../../cpp.xml;cpp\"");
+cmd(curdir+"haxedoc -v \"../../../../neko.xml;neko\" \"../../../../js.xml;js\" \"../../../../flash9.xml;flash\" \"../../../../php.xml;php\" \"../../../../cpp.xml;cpp\"");
 cmd("mv index.html content ../../../doc");
 cmd("mv index.html content ../../../doc");
 cmd("mv haxedoc"+binext+" ../../..");
 cmd("mv haxedoc"+binext+" ../../..");
 chdir("..");
 chdir("..");

+ 2 - 2
filters.ml

@@ -631,7 +631,7 @@ let rename_local_vars ctx e =
 			let old = save() in
 			let old = save() in
 			(* we have to look ahead for vars on these targets (issue #3344) *)
 			(* we have to look ahead for vars on these targets (issue #3344) *)
 			begin match ctx.com.platform with
 			begin match ctx.com.platform with
-				| Js | Flash8 ->
+				| Js ->
 					let rec check_var e = match e.eexpr with
 					let rec check_var e = match e.eexpr with
 						| TVar (v,eo) ->
 						| TVar (v,eo) ->
 							(match eo with None -> () | Some e -> loop e);
 							(match eo with None -> () | Some e -> loop e);
@@ -1098,7 +1098,7 @@ let run com tctx main =
 			Codegen.AbstractCast.handle_abstract_casts tctx;
 			Codegen.AbstractCast.handle_abstract_casts tctx;
 			blockify_ast;
 			blockify_ast;
 			( if (Common.defined com Define.NoSimplify) || (Common.defined com Define.Cppia) ||
 			( if (Common.defined com Define.NoSimplify) || (Common.defined com Define.Cppia) ||
-						( match com.platform with Cpp | Flash8 -> false | _ -> true ) then
+						( match com.platform with Cpp -> false | _ -> true ) then
 					fun e -> e
 					fun e -> e
 				else
 				else
 					fun e ->
 					fun e ->

+ 3 - 35
genswf.ml

@@ -730,35 +730,6 @@ let remove_classes toremove lib hcl =
 			toremove := List.filter (fun p -> not (List.mem p classes)) !toremove;
 			toremove := List.filter (fun p -> not (List.mem p classes)) !toremove;
 			fst lib, tags (snd lib)
 			fst lib, tags (snd lib)
 
 
-let build_swf8 com codeclip exports =
-	let code, clips = Genswf8.generate com in
-	let cid = ref 0 in
-	let clips = List.fold_left (fun acc m ->
-		let ename = Ast.s_type_path m in
-		if Hashtbl.mem exports ename then
-			acc
-		else begin
-			incr cid;
-			tag ~ext:true (TClip { c_id = !cid; c_frame_count = 1; c_tags = [] }) ::
-			tag ~ext:true (TExport [{ exp_id = !cid; exp_name = ename }]) ::
-			acc
-		end;
-	) [] clips in
-	let code = (match codeclip with
-		| None -> List.map tag code
-		| Some link ->
-			incr cid;
-			[
-				tag (TClip {
-					c_id = !cid;
-					c_frame_count = 1;
-					c_tags = List.map tag code @ [tag TShowFrame];
-				});
-				tag (TExport [{ exp_id = !cid; exp_name = link }]);
-			]
-	) in
-	clips @ code
-
 type file_format =
 type file_format =
 	| BJPG
 	| BJPG
 	| BPNG
 	| BPNG
@@ -1062,7 +1033,6 @@ let merge com file priority (h1,tags1) (h2,tags2) =
 			classes := !classes @ List.map (fun e -> { f9_cid = Some e.exp_id; f9_classname = e.exp_name }) el;
 			classes := !classes @ List.map (fun e -> { f9_cid = Some e.exp_id; f9_classname = e.exp_name }) el;
 			false
 			false
 		| TF9Classes el when !nframe = 0 ->
 		| TF9Classes el when !nframe = 0 ->
-			if com.flash_version < 9. then failwith "You can't use AS3 SWF with Flash8 target";
 			classes := !classes @ List.filter (fun e -> e.f9_cid <> None) el;
 			classes := !classes @ List.filter (fun e -> e.f9_cid <> None) el;
 			false
 			false
 		| _ -> true
 		| _ -> true
@@ -1108,9 +1078,7 @@ let merge com file priority (h1,tags1) (h2,tags2) =
 
 
 let generate com swf_header =
 let generate com swf_header =
 	let t = Common.timer "generate swf" in
 	let t = Common.timer "generate swf" in
-	let isf9 = com.flash_version >= 9. in
 	let swc = if Common.defined com Define.Swc then Some (ref "") else None in
 	let swc = if Common.defined com Define.Swc then Some (ref "") else None in
-	if swc <> None && not isf9 then failwith "SWC support is only available for Flash9+";
 	let file , codeclip = (try let f , c = ExtString.String.split com.file "@" in f, Some c with _ -> com.file , None) in
 	let file , codeclip = (try let f , c = ExtString.String.split com.file "@" in f, Some c with _ -> com.file , None) in
 	(* list exports *)
 	(* list exports *)
 	let exports = Hashtbl.create 0 in
 	let exports = Hashtbl.create 0 in
@@ -1144,7 +1112,7 @@ let generate com swf_header =
 		) tags;
 		) tags;
 	) com.swf_libs;
 	) com.swf_libs;
 	(* build haxe swf *)
 	(* build haxe swf *)
-	let tags = if isf9 then build_swf9 com file swc else build_swf8 com codeclip exports in
+	let tags = build_swf9 com file swc in
 	let header, bg = (match swf_header with None -> default_header com | Some h -> convert_header com h) in
 	let header, bg = (match swf_header with None -> default_header com | Some h -> convert_header com h) in
 	let bg = tag (TSetBgColor { cr = bg lsr 16; cg = (bg lsr 8) land 0xFF; cb = bg land 0xFF }) in
 	let bg = tag (TSetBgColor { cr = bg lsr 16; cg = (bg lsr 8) land 0xFF; cb = bg land 0xFF }) in
 	let swf_debug_password = try
 	let swf_debug_password = try
@@ -1152,7 +1120,7 @@ let generate com swf_header =
 	with Not_found ->
 	with Not_found ->
 		""
 		""
 	in
 	in
-	let debug = (if isf9 && Common.defined com Define.Fdb then [tag (TEnableDebugger2 (0, swf_debug_password))] else []) in
+	let debug = (if Common.defined com Define.Fdb then [tag (TEnableDebugger2 (0, swf_debug_password))] else []) in
 	let meta_data =
 	let meta_data =
 		try
 		try
 			let file = Common.defined_value com Define.SwfMetadata in
 			let file = Common.defined_value com Define.SwfMetadata in
@@ -1165,7 +1133,7 @@ let generate com swf_header =
 	let fattr = (if com.flash_version < 8. then [] else
 	let fattr = (if com.flash_version < 8. then [] else
 		[tag (TFilesAttributes {
 		[tag (TFilesAttributes {
 			fa_network = Common.defined com Define.NetworkSandbox;
 			fa_network = Common.defined com Define.NetworkSandbox;
-			fa_as3 = isf9;
+			fa_as3 = true;
 			fa_metadata = meta_data <> [];
 			fa_metadata = meta_data <> [];
 			fa_gpu = com.flash_version > 9. && Common.defined com Define.SwfGpu;
 			fa_gpu = com.flash_version > 9. && Common.defined com Define.SwfGpu;
 			fa_direct_blt = com.flash_version > 9. && Common.defined com Define.SwfDirectBlit;
 			fa_direct_blt = com.flash_version > 9. && Common.defined com Define.SwfDirectBlit;

+ 0 - 1590
genswf8.ml

@@ -1,1590 +0,0 @@
-(*
- * Copyright (C)2005-2013 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *)
-
-open Swf
-open Ast
-open Type
-open Common
-
-type register =
-	| NoReg
-	| Reg of int
-
-type context = {
-
-	stack : Codegen.stack_context;
-
-	(* segs *)
-	mutable segs : (actions * (string * bool, int) Hashtbl.t) list;
-
-	(* code *)
-	mutable opcodes : actions;
-	mutable code_pos : int;
-	mutable stack_size : int;
-	mutable opt_push : bool;
-	mutable ident_count : int;
-	mutable ident_size : int;
-
-	(* management *)
-	com : Common.context;
-	packages : (string list,unit) Hashtbl.t;
-	flash6 : bool;
-	mutable idents : (string * bool,int) Hashtbl.t;
-	mutable movieclips : path list;
-	mutable inits : texpr list;
-	mutable statics : (tclass * bool * string * texpr) list;
-	mutable regs : (string,register) PMap.t;
-	mutable reg_count : int;
-	mutable reg_max : int;
-	mutable fun_stack : int;
-	mutable curclass : tclass;
-	mutable curmethod : (string * bool);
-	mutable fun_pargs : (int * bool list) list;
-	mutable static_init : bool;
-	mutable extern_boot : bool;
-
-	(* loops *)
-	mutable breaks : (unit -> unit) list;
-	mutable continues : (int -> unit) list;
-	mutable loop_stack : int;
-	mutable in_loop : bool;
-}
-
-let invalid_expr p = error "Invalid expression" p
-let stack_error p = error "Stack error" p
-let protect_all = ref true
-
-(* -------------------------------------------------------------- *)
-(* Bytecode Helpers *)
-
-type tmp_variable =
-	| TmpReg of int
-	| TmpVar of string * int
-
-type kind =
-	| VarReg of int
-	| VarStr
-	| VarObj
-	| VarClosure
-	| VarVolatile
-
-type push_style =
-	| VStr of string * bool
-	| VInt of int
-	| VInt32 of int32
-	| VFloat of float
-	| VReg of int
-	| VThis
-	| VNull
-	| VUndefined
-	| VSuper
-
-let stack_delta = function
-	| APush l -> List.length l
-	| ASetReg _ -> 0
-	| AAdd | ADivide | ASubtract | AMultiply | AMod | AStringAdd -> -1
-	| AAnd | AOr | AXor | AShl | AShr | AAsr -> -1
-	| ACompare | AGreater -> -1
-	| AEval | ANot | AJump _ | AToInt | AToNumber | AToString | ATry _ | ASwap -> 0
-	| ACondJump _ -> -1
-	| AEqual | APhysEqual -> -1
-	| ANew -> -1 (** only if 0 params **)
-	| AObject | AInitArray -> 0 (** calculated outside **)
-	| ASet -> -2
-	| APop -> -1
-	| AFunction _ | AFunction2 _ -> 1
-	| ADup -> 1
-	| AWith _ -> -1
-	| AObjGet -> -1
-	| AObjSet -> -3
-	| ALocalVar -> -1
-	| ALocalAssign -> -2
-	| AReturn -> -1
-	| AGetURL2 _ -> -2
-	| ADeleteObj | AInstanceOf | ACast -> -1
-	| AExtends | AImplements -> -2
-	| AEnum2 | ATrace | AThrow -> -1
-	| AGetTimer -> 1
-	| AIncrement | ADecrement | AChr | AOrd | ARandom | ADelete | ATypeOf | ATargetPath -> 0
-	| AObjCall | ACall | ANewMethod -> assert false
-	| AStringPool _ -> 0
-	| AFSCommand2 -> 0
-	| op -> failwith ("Unknown stack delta for " ^ (ActionScript.action_string (fun _ -> "") 0 op))
-
-let overflow ctx =
-	failwith ("In or near the method " ^ s_type_path ctx.curclass.cl_path ^ "." ^ fst ctx.curmethod ^
-	" too much code is causing an overflow that can't be handled by the SWF format. " ^
-	"Please split your code in several methods so it can be correctly compiled.")
-
-let write ctx op =
-	let write b op =
-		DynArray.add ctx.opcodes op;
-		ctx.code_pos <- ctx.code_pos + 1;
-		ctx.stack_size <- ctx.stack_size + stack_delta op;
-		ctx.opt_push <- b
-	in
-	match op with
-	| APush l when ctx.opt_push ->
-		(match DynArray.last ctx.opcodes with
-		| (APush l2) as a ->
-			ctx.code_pos <- ctx.code_pos - 1;
-			ctx.stack_size <- ctx.stack_size - stack_delta a;
-			DynArray.delete_last ctx.opcodes;
-			write true (APush (l2 @ l))
-		| _ ->
-			assert false)
-	| APush _ ->
-		write true op
-	| _ ->
-		write false op
-
-let call ctx kind n =
-	let op , n = (match kind with
-		| VarReg r ->
-			write ctx (APush [PReg r;PUndefined]);
-			AObjCall , n + 2
-		| VarStr ->
-			ACall , n + 1
-		| VarClosure | VarObj ->
-			AObjCall , n + 2
-		| VarVolatile ->
-			assert false
-	) in
-	DynArray.add ctx.opcodes op;
-	ctx.opt_push <- false;
-	ctx.code_pos <- ctx.code_pos + 1;
-	ctx.stack_size <- ctx.stack_size - n
-
-let new_call ctx kind n  =
-	let op , n = (match kind with
-		| VarReg r ->
-			write ctx (APush [PReg r;PUndefined]);
-			ANewMethod , n + 2
-		| VarStr ->
-			ANew , n + 1
-		| VarClosure | VarObj ->
-			ANewMethod , n + 2
-		| VarVolatile ->
-			assert false
-	) in
-	DynArray.add ctx.opcodes op;
-	ctx.opt_push <- false;
-	ctx.code_pos <- ctx.code_pos + 1;
-	ctx.stack_size <- ctx.stack_size - n
-
-let unprotect a = !protect_all || a = "" || a = "_" || (a.[0] = '_' && a.[1] != '_')
-
-let rec is_protected_path path ext =
-	match path with
-	| ["flash"] , "Boot" | ["flash"] , "Lib" -> false
-	| "flash" :: _ , _ | [] , "flash" -> ext
-	| [] , "Array" | [] , "Math" | [] , "Date" | [] , "String" | [] , "Bool" -> true
-	| [] , "Int" | [] , "Float" -> true
-	| "_global" :: l , n -> is_protected_path (l,n) ext
-	| _ -> false
-
-let rec is_protected ctx ?(stat=false) t field =
-	match follow t with
-	| TInst (c,_) ->
-		let rec loop c =
-			(is_protected_path c.cl_path c.cl_extern && PMap.mem field (if stat then c.cl_statics else c.cl_fields))
-			|| List.exists (fun (i,_) -> i.cl_path = (["mt"],"Protect") || (not stat && loop i)) c.cl_implements
-			|| (not stat && match c.cl_super with None -> false | Some (c,_) -> loop c)
-		in
-		loop c
-	| TAnon a ->
-		(match !(a.a_status) with
-		| Statics c -> is_protected ctx ~stat:true (TInst (c,[])) field
-		| _ -> false)
-	| _ -> false
-
-let push ctx items =
-	write ctx (APush (List.map (fun i ->
-		match i with
-		| VStr (str,flag) ->
-			let flag = if flag || unprotect str then true else flag in
-			let n = (try
-				Hashtbl.find ctx.idents (str,flag)
-			with Not_found ->
-				let n = ctx.ident_count in
-				ctx.ident_count <- n + 1;
-				ctx.ident_size <- ctx.ident_size + 1 + String.length str;
-				Hashtbl.add ctx.idents (str,flag) n;
-				n
-			) in
-			if n <= 0xFF then
-				PStack n
-			else
-				PStack2 n
-		| VInt n ->
-			PInt (Int32.of_int n)
-		| VInt32 n ->
-			PInt n
-		| VFloat f ->
-			PDouble f
-		| VThis ->
-			PReg 1
-		| VNull ->
-			PNull
-		| VUndefined ->
-			PUndefined
-		| VSuper ->
-			PReg 2
-		| VReg n ->
-			PReg n
-	) items))
-
-let pop ctx n dec =
-	let rec loop n =
-		if n <> 0 then begin
-			write ctx APop;
-			loop (n - 1)
-		end;
-	in
-	if n < 0 then assert false;
-	let old_s = ctx.stack_size in
-	loop n;
-	if not dec then ctx.stack_size <- old_s
-
-let cjmp ctx =
-	write ctx (ACondJump 0);
-	let start_pos = ctx.code_pos in
-	let op_pos = DynArray.length ctx.opcodes - 1 in
-	(fun() ->
-		let delta = ctx.code_pos - start_pos in
-		DynArray.set ctx.opcodes op_pos (ACondJump delta);
-		ctx.opt_push <- false
-	)
-
-let jmp ctx =
-	write ctx (AJump 0);
-	let start_pos = ctx.code_pos in
-	let op_pos = DynArray.length ctx.opcodes - 1 in
-	(fun() ->
-		let delta = ctx.code_pos - start_pos in
-		DynArray.set ctx.opcodes op_pos (AJump delta);
-		ctx.opt_push <- false
-	)
-
-let pos ctx =
-	ctx.opt_push <- false;
-	let start_pos = ctx.code_pos in
-	(fun ~cond ->
-		let delta = start_pos - (ctx.code_pos + 1) in
-		write ctx (if cond then ACondJump delta else AJump delta);
-	)
-
-let jmp_pos ctx cond =
-	write ctx (AJump 0);
-	let start_pos = ctx.code_pos in
-	let op_pos = DynArray.length ctx.opcodes - 1 in
-	(fun pos ->
-		let delta = pos - start_pos in
-		DynArray.set ctx.opcodes op_pos (if cond then ACondJump delta else AJump delta);
-		ctx.opt_push <- false
-	)
-
-let init_array ctx n =
-	push ctx [VInt n];
-	write ctx AInitArray;
-	ctx.stack_size <- ctx.stack_size - n
-
-let setvar ?(retval=false) ctx = function
-	| VarReg (-1) -> assert false (** true, false, null **)
-	| VarReg n -> write ctx (ASetReg n); if not retval then write ctx APop
-	| VarStr
-	| VarObj
-	| VarClosure as s ->
-		if retval then write ctx (ASetReg 0);
-		write ctx (if s = VarStr then ASet else AObjSet);
-		if retval then push ctx [VReg 0]
-	| VarVolatile ->
-		if retval then write ctx (ASetReg 0);
-		init_array ctx 1;
-		write ctx AObjSet;
-		if retval then push ctx [VReg 0]
-
-let getvar ctx = function
-	| VarReg (-1) -> () (** true, false, null **)
-	| VarReg n -> push ctx [VReg n]
-	| VarStr -> write ctx AEval
-	| VarObj -> write ctx AObjGet
-	| VarClosure ->
-		push ctx [VInt 2; VStr ("@closure",false)];
-		call ctx VarStr 2
-	| VarVolatile ->
-		write ctx AObjGet;
-		push ctx [VInt 0];
-		write ctx AObjGet
-
-let gen_path ctx ?(protect=false) (p,t) is_extern =
-	let flag = is_protected_path (p,t) is_extern in
-	match p with
-	| [] ->
-		push ctx [VStr (t,flag)];
-		VarStr
-	| x :: l ->
-		push ctx [VStr (x,protect && flag)];
-		write ctx AEval;
-		List.iter (fun x ->
-			push ctx [VStr (x,protect && flag)];
-			write ctx AObjGet;
-		) l;
-		push ctx [VStr (t,flag)];
-		VarObj
-
-let begin_func ctx need_super need_args args =
-	if ctx.flash6 then
-		let f = {
-			f_name = "";
-			Swf.f_args = List.map snd args;
-			f_codelen = 0;
-		} in
-		write ctx (AFunction f);
-		let start_pos = ctx.code_pos in
-		let old_stack = ctx.fun_stack in
-		ctx.fun_stack <- ctx.stack_size;
-		(fun() ->
-			let delta = ctx.code_pos - start_pos in
-			f.f_codelen <- delta;
-			let codesize = ActionScript.jump_index_to_size ctx.opcodes (start_pos-1) delta in
-			if codesize >= 1 lsl 16 then overflow ctx;
-			if ctx.fun_stack <> ctx.stack_size then assert false;
-			ctx.fun_stack <- old_stack;
-		)
-	else
-	let default_flags = ThisRegister :: (if need_args then [] else [ArgumentsNoVar]) in
-	let f = {
-		f2_name = "";
-		f2_args = args;
-		f2_codelen = 0;
-		f2_nregs = 0;
-		f2_flags = (if need_super then SuperRegister :: default_flags else SuperNoVar :: default_flags);
-	} in
-	write ctx (AFunction2 f);
-	let start_pos = ctx.code_pos in
-	let old_stack = ctx.fun_stack in
-	let old_rmax = ctx.reg_max in
-	let old_sinit = ctx.static_init in
-	ctx.fun_stack <- ctx.stack_size;
-	ctx.reg_max <- ctx.reg_count;
-	ctx.static_init <- false;
-	(fun() ->
-		let delta = ctx.code_pos - start_pos in
-		f.f2_codelen <- delta;
-		f.f2_nregs <- ctx.reg_max + 1;
-		let codesize = ActionScript.jump_index_to_size ctx.opcodes (start_pos-1) delta in
-		if codesize >= 1 lsl 16 then overflow ctx;
-		if ctx.fun_stack <> ctx.stack_size then assert false;
-		ctx.fun_stack <- old_stack;
-		ctx.reg_max <- old_rmax;
-		ctx.static_init <- old_sinit;
-	)
-
-let open_block ctx =
-	let old_regs = ctx.regs in
-	let old_rcount = ctx.reg_count in
-	(fun() ->
-		ctx.regs <- old_regs;
-		ctx.reg_count <- old_rcount;
-	)
-
-let begin_loop ctx =
-	let old_breaks = ctx.breaks in
-	let old_cont = ctx.continues in
-	let old_stack = ctx.loop_stack in
-	let old_loop = ctx.in_loop in
-	ctx.breaks <- [];
-	ctx.continues <- [];
-	ctx.loop_stack <- ctx.stack_size;
-	ctx.in_loop <- true;
-	(fun pos ->
-		List.iter (fun f -> f()) ctx.breaks;
-		List.iter (fun f -> f pos) ctx.continues;
-		ctx.breaks <- old_breaks;
-		ctx.continues <- old_cont;
-		ctx.loop_stack <- old_stack;
-		ctx.in_loop <- old_loop;
-	)
-
-let alloc_reg ctx =
-	ctx.reg_count <- ctx.reg_count + 1;
-	if ctx.reg_count > ctx.reg_max then ctx.reg_max <- ctx.reg_count;
-	ctx.reg_count
-
-let free_reg ctx r p =
-	if r <> ctx.reg_count then stack_error p;
-	ctx.reg_count <- ctx.reg_count - 1
-
-let segment ctx =
-	ctx.segs <- (ctx.opcodes,ctx.idents) :: ctx.segs;
-	ctx.opcodes <- DynArray.create();
-	ctx.idents <- Hashtbl.create 0;
-	ctx.ident_count <- 0;
-	ctx.ident_size <- 0;
-	ctx.code_pos <- 0;
-	write ctx (AStringPool [])
-
-(* -------------------------------------------------------------- *)
-(* Generation Helpers *)
-
-let define_var ctx v ef =
-	if ctx.flash6 || v.v_capture || ctx.static_init then begin
-		push ctx [VStr (v.v_name,false)];
-		ctx.regs <- PMap.add v.v_name NoReg ctx.regs;
-		match ef with
-		| None ->
-			write ctx ALocalVar
-		| Some f ->
-			f();
-			write ctx ALocalAssign
-	end else begin
-		let r = alloc_reg ctx in
-		ctx.regs <- PMap.add v.v_name (Reg r) ctx.regs;
-		match ef with
-		| None -> ()
-		| Some f ->
-			f();
-			setvar ctx (VarReg r)
-	end
-
-let alloc_tmp ctx =
-	let r = alloc_reg ctx in
-	if ctx.flash6 then
-		let name = "$" ^ string_of_int r in
-		define_var ctx (alloc_var name t_dynamic) None;
-		TmpVar (name,r);
-	else
-		TmpReg r
-
-let get_tmp ctx = function
-	| TmpVar (v,_) ->
-		push ctx [VStr (v,false)];
-		write ctx AEval;
-	| TmpReg r ->
-		push ctx [VReg r]
-
-let set_tmp ctx = function
-	| TmpVar (v,_) ->
-		write ctx ADup;
-		push ctx [VStr (v,false)];
-		write ctx ASwap;
-		write ctx ASet
-	| TmpReg r ->
-		write ctx (ASetReg r)
-
-let free_tmp ctx v p =
-	match v with
-	| TmpVar (v,r) ->
-		ctx.regs <- PMap.remove v ctx.regs;
-		free_reg ctx r p
-	| TmpReg r ->
-		free_reg ctx r p
-
-let no_value ctx retval =
-	(* does not push a null but still increment the stack like if
-	   a real value was pushed *)
-	if retval then ctx.stack_size <- ctx.stack_size + 1
-
-let gen_try ctx =
-	let tdata = {
-		tr_style = TryRegister 0;
-		tr_trylen = 0;
-		tr_catchlen = None;
-		tr_finallylen = None;
-	} in
-	write ctx (ATry tdata);
-	let start = ctx.code_pos in
-	(fun() ->
-		let jump_end = jmp ctx in
-		tdata.tr_trylen <- ctx.code_pos - start;
-		let start = ctx.code_pos in
-		(fun() ->
-			if ctx.code_pos <> start then tdata.tr_catchlen <- Some (ctx.code_pos - start);
-			jump_end()
-		)
-	)
-
-(* -------------------------------------------------------------- *)
-(* Generation *)
-
-let rec gen_big_string ctx s =
-	let len = String.length s in
-	let max = 65000 in
-	ctx.opt_push <- false;
-	if len <= max then
-		write ctx (APush [PString s])
-	else begin
-		write ctx (APush [PString (String.sub s 0 max)]);
-		gen_big_string ctx (String.sub s max (len - max));
-		write ctx AAdd;
-	end
-
-let rec gen_constant ctx c p =
-	match c with
-	| TInt i -> push ctx [VInt32 i]
-	| TFloat s -> push ctx [VFloat (try float_of_string s with _ -> invalid_expr p)]
-	| TString s ->
-		if String.contains s '\000' then error "A String cannot contain \\0 characters" p;
-		push ctx [VStr (s,true)]
-	| TBool b -> write ctx (APush [PBool b])
-	| TNull -> push ctx [VNull]
-	| TThis
-	| TSuper -> assert false
-
-let access_local ctx s =
-	match (try PMap.find s ctx.regs , false with Not_found -> NoReg, s <> "Enum") with
-	| NoReg , flag ->
-		push ctx [VStr (s,flag)];
-		VarStr
-	| Reg r , _ ->
-		VarReg r
-
-let rec gen_access ?(read_write=false) ctx forcall e =
-	match e.eexpr with
-	| TConst TSuper ->
-		(* for superconstructor *)
-		if ctx.flash6 then begin
-			push ctx [VStr ("super",true)];
-			VarStr
-		end else if forcall then begin
-			push ctx [VSuper];
-			write ctx (APush [PUndefined]);
-			VarObj
-		end else
-			VarReg 2
-	| TConst TThis ->
-		if ctx.flash6 then begin
-			push ctx [VStr ("this",true)];
-			VarStr
-		end else
-			VarReg 1
-	| TLocal { v_name = "__arguments__" } ->
-		push ctx [VStr ("arguments",true)];
-		VarStr
-	| TLocal v ->
-		access_local ctx v.v_name
-	| TField (e,FClosure (_,{ cf_name = f })) ->
-		gen_expr ctx true e;
-		if read_write then assert false;
-		push ctx [VStr (f,is_protected ctx e.etype f)];
-		VarClosure
-	| TEnumParameter(e,_,i) ->
-		gen_expr ctx true e;
-		push ctx [VInt (i + 2)];
-		VarObj
-	| TField (e2,f) ->
-		gen_expr ctx true e2;
-		if read_write then write ctx ADup;
-		let f = field_name f in
-		let p = VStr (f,is_protected ctx e2.etype f) in
-		push ctx [p];
-		if read_write then begin
-			write ctx ASwap;
-			push ctx [p];
-		end;
-		if not !protect_all && Codegen.is_volatile e.etype then
-			VarVolatile
-		else
-			VarObj
-	| TArray (ea,eb) ->
-		if read_write then
-			try
-				let r = (match ea.eexpr with TLocal l -> (match PMap.find l.v_name ctx.regs with Reg r -> r | _ -> raise Not_found) | _ -> raise Not_found) in
-				push ctx [VReg r];
-				gen_expr ctx true eb;
-				write ctx ADup;
-				push ctx [VReg r];
-				write ctx ASwap;
-			with Not_found ->
-				gen_expr ctx true eb;
-				gen_expr ctx true ea;
-				write ctx (ASetReg 0);
-				write ctx ASwap;
-				write ctx ADup;
-				push ctx [VReg 0];
-				write ctx ASwap;
-		else begin
-			gen_expr ctx true ea;
-			gen_expr ctx true eb;
-		end;
-		VarObj
-	| TTypeExpr t ->
-		(match t with
-		| TClassDecl c -> gen_path ctx c.cl_path c.cl_extern
-		| TEnumDecl e -> gen_path ctx e.e_path false
-		| TAbstractDecl a -> gen_path ctx a.a_path false
-		| TTypeDecl _ -> assert false)
-	| _ ->
-		if not forcall then invalid_expr e.epos;
-		gen_expr ctx true e;
-		write ctx (APush [PUndefined]);
-		VarObj
-
-and gen_access_rw ctx e =
-	match e.eexpr with
-	| TField ({ eexpr = TLocal _ },_) | TArray ({ eexpr = TLocal _ },{ eexpr = TConst _ }) | TArray ({ eexpr = TLocal _ },{ eexpr = TLocal _ }) ->
-		ignore(gen_access ctx false e);
-		gen_access ctx false e
-	| TField _ | TArray _ ->
-		gen_access ~read_write:true ctx false e
-	| _ ->
-		ignore(gen_access ctx false e);
-		gen_access ctx false e
-
-and gen_try_catch ctx retval e catchs =
-	let start_try = gen_try ctx in
-	gen_expr ctx retval e;
-	let end_try = start_try() in
-	let end_throw = ref true in
-	let jumps = List.map (fun (v,e) ->
-		if not !end_throw then
-			(fun () -> ())
-		else let t = (match follow v.v_type with
-			| TEnum (e,_) -> Some (TEnumDecl e)
-			| TInst (c,_) -> Some (TClassDecl c)
-			| TAbstract (a,_) -> Some (TAbstractDecl a)
-			| TFun _
-			| TLazy _
-			| TType _
-			| TAnon _ ->
-				assert false
-			| TMono _
-			| TDynamic _ ->
-				None
-		) in
-		let next_catch = (match t with
-		| None ->
-			end_throw := false;
-			(fun() -> ())
-		| Some t ->
-			getvar ctx (gen_access ctx false (mk (TTypeExpr t) (mk_mono()) e.epos));
-			push ctx [VReg 0; VInt 2; VStr ("@instanceof",false)];
-			call ctx VarStr 2;
-			write ctx ANot;
-			cjmp ctx
-		) in
-		let block = open_block ctx in
-		define_var ctx v (Some (fun() -> push ctx [VReg 0]));
-		gen_expr ctx retval e;
-		block();
-		if retval then ctx.stack_size <- ctx.stack_size - 1;
-		let j = jmp ctx in
-		next_catch();
-		j
-	) catchs in
-	if !end_throw && catchs <> [] then begin
-		push ctx [VReg 0];
-		write ctx AThrow;
-	end;
-	List.iter (fun j -> j()) jumps;
-	end_try()
-
-and gen_switch ctx retval e cases def =
-	gen_expr ctx true e;
-	let r = alloc_tmp ctx in
-	set_tmp ctx r;
-	let first = ref true in
-	let dispatch = List.map (fun (el,x) ->
-		List.map (fun e ->
-			if !first then first := false else get_tmp ctx r;
-			gen_expr ctx true e;
-			write ctx AEqual;
-			cjmp ctx
-		) el , x
-	) cases in
-	if !first then write ctx APop;
-	(match def with
-	| None -> if retval then push ctx [VNull]
-	| Some e -> gen_expr ctx retval e);
-	let jend = jmp ctx in
-	let jends = List.map (fun (jl,e) ->
-		List.iter (fun j -> j()) jl;
-		gen_expr ctx retval e;
-		if retval then ctx.stack_size <- ctx.stack_size - 1;
-		jmp ctx;
-	) dispatch in
-	jend();
-	free_tmp ctx r e.epos;
-	List.iter (fun j -> j()) jends
-
-and gen_match ctx retval e cases def =
-	gen_expr ctx true e;
-	let renum = alloc_tmp ctx in
-	set_tmp ctx renum;
-	push ctx [VInt 1];
-	write ctx AObjGet;
-	let rtag = alloc_tmp ctx in
-	set_tmp ctx rtag;
-	let first = ref true in
-	let dispatch = List.map (fun (cl,params,e) ->
-		List.map (fun c ->
-			if !first then first := false else get_tmp ctx rtag;
-			push ctx [VInt c];
-			write ctx APhysEqual;
-			cjmp ctx
-		) cl, params, e
-	) cases in
-	if !first then write ctx APop;
-	free_tmp ctx rtag e.epos;
-	(match def with
-	| None -> if retval then push ctx [VNull]
-	| Some e -> gen_expr ctx retval e);
-	let jend = jmp ctx in
-	let jends = List.map (fun (jl,args,e) ->
-		let regs = ctx.regs in
-		let nregs = ctx.reg_count in
-		List.iter (fun j -> j()) jl;
-		let n = ref 1 in
-		List.iter (fun v ->
-			incr n;
-			match v with
-			| None -> ()
-			| Some v ->
-				define_var ctx v (Some (fun() ->
-					get_tmp ctx renum;
-					push ctx [VInt !n];
-					write ctx AObjGet
-				))
-		) (match args with None -> [] | Some l -> l);
-		gen_expr ctx retval e;
-		if retval then ctx.stack_size <- ctx.stack_size - 1;
-		ctx.regs <- regs;
-		ctx.reg_count <- nregs;
-		jmp ctx;
-	) dispatch in
-	jend();
-	free_tmp ctx renum e.epos;
-	List.iter (fun j -> j()) jends
-
-and gen_binop ctx retval op e1 e2 =
-	let gen a =
-		gen_expr ctx true e1;
-		gen_expr ctx true e2;
-		write ctx a
-	in
-	let make_op = function
-		| OpAdd -> AAdd
-		| OpMult -> AMultiply
-		| OpDiv -> ADivide
-		| OpSub -> ASubtract
-		| OpAnd -> AAnd
-		| OpOr -> AOr
-		| OpXor -> AXor
-		| OpShl -> AShl
-		| OpShr -> AShr
-		| OpUShr -> AAsr
-		| OpMod -> AMod
-		| _ -> assert false
-	in
-	match op with
-	| OpAssign ->
-		let k = gen_access ctx false e1 in
-		gen_expr ctx true e2;
-		setvar ~retval ctx k
-	| OpAssignOp op ->
-		let k = gen_access_rw ctx e1 in
-		getvar ctx k;
-		gen_expr ctx true e2;
-		write ctx (make_op op);
-		setvar ~retval ctx k
-	| OpAdd | OpMult | OpDiv | OpSub | OpAnd | OpOr | OpXor | OpShl | OpShr | OpUShr | OpMod ->
-		gen (make_op op)
-	| OpEq ->
-		gen AEqual
-	| OpNotEq ->
-		gen AEqual;
-		write ctx ANot
-	| OpGt -> gen AGreater
-	| OpGte ->
-		gen ACompare;
-		write ctx ANot
-	| OpLt -> gen ACompare
-	| OpLte ->
-		gen AGreater;
-		write ctx ANot
-	| OpBoolAnd ->
-		gen_expr ctx true e1;
-		write ctx ADup;
-		write ctx ANot;
-		let jump_end = cjmp ctx in
-		write ctx APop;
-		gen_expr ctx true e2;
-		jump_end()
-	| OpBoolOr ->
-		gen_expr ctx true e1;
-		write ctx ADup;
-		let jump_end = cjmp ctx in
-		write ctx APop;
-		gen_expr ctx true e2;
-		jump_end()
-	| OpInterval | OpArrow ->
-		(* handled by typer *)
-		assert false
-
-and gen_unop ctx retval op flag e =
-	match op with
-	| Not ->
-		gen_expr ctx true e;
-		write ctx ANot
-	| Neg ->
-		push ctx [VInt 0];
-		gen_expr ctx true e;
-		write ctx ASubtract
-	| NegBits ->
-		gen_expr ctx true e;
-		push ctx [VInt (-1)];
-		write ctx AXor
-	| Increment
-	| Decrement ->
-		let k = gen_access_rw ctx e in
-		getvar ctx k;
-		(* store preincr value for later access *)
-		if retval && flag = Postfix then write ctx (ASetReg 0);
-		write ctx (match op with Increment -> AIncrement | Decrement -> ADecrement | _ -> assert false);
-		setvar ~retval:(retval && flag = Prefix) ctx k;
-		if retval && flag = Postfix then push ctx [VReg 0]
-
-and gen_call ctx e el =
-	let loc = match e.eexpr with TLocal v -> v.v_name | _ -> "" in
-	match loc, el with
-	| "__instanceof__" ,  [e1;e2] ->
-		gen_expr ctx true e1;
-		gen_expr ctx true e2;
-		write ctx AInstanceOf
-	| "__typeof__" , [e] ->
-		gen_expr ctx true e;
-		write ctx ATypeOf
-	| "__delete__" , [e1; e2] ->
-		gen_expr ctx true e1;
-		gen_expr ctx true e2;
-		write ctx ADeleteObj
-	| "__random__" , [e] ->
-		gen_expr ctx true e;
-		write ctx ARandom
-	| "__trace__" , [e] ->
-		gen_expr ctx true e;
-		write ctx ATrace
-	| "__eval__" , [e] ->
-		gen_expr ctx true e;
-		write ctx AEval
-	| "__gettimer__", [] ->
-		write ctx AGetTimer
-	| "__undefined__", [] ->
-		push ctx [VUndefined]
-	| "__geturl__" , url :: target :: post ->
-		gen_expr ctx true url;
-		gen_expr ctx true target;
-		write ctx (AGetURL2 (match post with [] -> 0 | [{ eexpr = TConst (TString "GET") }] -> 1 | _ -> 2))
-	| "__new__", e :: el ->
-		let nargs = List.length el in
-		List.iter (gen_expr ctx true) (List.rev el);
-		push ctx [VInt nargs];
-		let k = gen_access ctx true e in
-		new_call ctx k nargs
-	| "__keys__", [e2]
-	| "__hkeys__", [e2] ->
-		let r = alloc_tmp ctx in
-		push ctx [VInt 0; VStr ("Array",true)];
-		new_call ctx VarStr 0;
-		set_tmp ctx r;
-		write ctx APop;
-		gen_expr ctx true e2;
-		write ctx AEnum2;
-		ctx.stack_size <- ctx.stack_size + 1; (* fake *)
-		let loop = pos ctx in
-		write ctx (ASetReg 0);
-		push ctx [VNull];
-		write ctx AEqual;
-		let jump_end = cjmp ctx in
-		if loc = "__hkeys__" then begin
-			push ctx [VInt 1; VInt 1; VReg 0; VStr ("substr",true)];
-			call ctx VarObj 1;
-		end else begin
-			push ctx [VReg 0];
-		end;
-		push ctx [VInt 1];
-		get_tmp ctx r;
-		push ctx [VStr ("push",true)];
-		call ctx VarObj 1;
-		write ctx APop;
-		loop false;
-		jump_end();
-		get_tmp ctx r;
-		free_tmp ctx r e2.epos;
-	| "__physeq__" ,  [e1;e2] ->
-		gen_expr ctx true e1;
-		gen_expr ctx true e2;
-		write ctx APhysEqual;
-	| "__unprotect__", [{ eexpr = TConst (TString s) }] ->
-		push ctx [VStr (s,false)]
-	| "__resources__", [] ->
-		let count = ref 0 in
-		Hashtbl.iter (fun name data ->
-			incr count;
-			push ctx [VStr ("name",false);VStr (name,true)];
-			(* if the data contains \0 or is not UTF8 valid, encode into bytes *)
-			(try
-				(try ignore(String.index data '\000'); raise Exit; with Not_found -> ());
-				UTF8.validate data;
-				push ctx [VStr ("str",false)];
-				gen_big_string ctx data;
-			with _ ->
-				push ctx [VStr ("data",false)];
-				gen_big_string ctx (Codegen.bytes_serialize data));
-			push ctx [VInt 2];
-			write ctx AObject;
-			ctx.stack_size <- ctx.stack_size - 4;
-		) ctx.com.resources;
-		init_array ctx !count
-	| "__FSCommand2__", l ->
-		let nargs = List.length l in
-		List.iter (gen_expr ctx true) (List.rev l);
-		push ctx [VInt nargs];
-		write ctx AFSCommand2;
-		ctx.stack_size <- ctx.stack_size - nargs
-	| _ , _ ->
-		let nargs = List.length el in
-		List.iter (gen_expr ctx true) (List.rev el);
-		push ctx [VInt nargs];
-		let k = gen_access ctx true e in
-		call ctx k nargs
-
-
-and gen_expr_2 ctx retval e =
-	match e.eexpr with
-	| TConst TSuper
-	| TConst TThis
-	| TEnumParameter _
-	| TField _
-	| TArray _
-	| TLocal _
-	| TTypeExpr _ ->
-		getvar ctx (gen_access ctx false e)
-	| TConst c ->
-		gen_constant ctx c e.epos
-	| TParenthesis e | TMeta (_,e) ->
-		gen_expr ctx retval e
-	| TBlock el ->
-		let rec loop = function
-			| [] ->
-				if retval then push ctx [VNull]
-			| [e] ->
-				gen_expr ctx retval e
-			| e :: l ->
-				gen_expr ctx false e;
-				loop l
-		in
-		let b = open_block ctx in
-		loop el;
-		b()
-	| TVar (v,eo) ->
-		define_var ctx v (match eo with None -> None | Some e -> Some (fun() -> gen_expr ctx true e));
-		if retval then push ctx [VNull]
-	| TArrayDecl el ->
-		List.iter (gen_expr ctx true) (List.rev el);
-		init_array ctx (List.length el);
-	| TObjectDecl fl ->
-		let nfields = List.length fl in
-		List.iter (fun (s,v) ->
-			push ctx [VStr (s,false)];
-			gen_expr ctx true v
-		) fl;
-		push ctx [VInt nfields];
-		write ctx AObject;
-		ctx.stack_size <- ctx.stack_size - (nfields * 2);
-	| TFunction f ->
-		let block = open_block ctx in
-		let old_in_loop = ctx.in_loop in
-		let old_meth = ctx.curmethod in
-		let rec loop e =
-			match e.eexpr with
-			| TConst TSuper -> raise Exit
-			| _ -> Type.iter loop e
-		in
-		let reg_super = try loop f.tf_expr; false with Exit -> true in
-		let rec loop e =
-			match e.eexpr with
-			| TLocal { v_name = "__arguments__" } -> raise Exit
-			| _ -> Type.iter loop e
-		in
-		let reg_args = try loop f.tf_expr; false with Exit -> true in
-		if snd ctx.curmethod then
-			ctx.curmethod <- (fst ctx.curmethod ^ "@" ^ string_of_int (Lexer.get_error_line e.epos), true)
-		else
-			ctx.curmethod <- (fst ctx.curmethod, true);
-		(* only keep None bindings, for protect *)
-		ctx.regs <- PMap.foldi (fun v x acc ->
-			match x with
-			| NoReg -> PMap.add v x acc
-			| Reg _ -> acc
-		) ctx.regs PMap.empty;
-		ctx.reg_count <- (if reg_super then 2 else 1);
-		ctx.in_loop <- false;
-		let pargs = ref [] in
-		let rargs = List.map (fun (v,_) ->
-			let no_reg = ctx.flash6 || v.v_capture in
-			if no_reg then begin
-				ctx.regs <- PMap.add v.v_name NoReg ctx.regs;
-				pargs := unprotect v.v_name :: !pargs;
-				0 , v.v_name
-			end else begin
-				let r = alloc_reg ctx in
-				ctx.regs <- PMap.add v.v_name (Reg r) ctx.regs;
-				pargs := false :: !pargs;
-				r , ""
-			end
-		) f.tf_args in
-		let tf = begin_func ctx reg_super reg_args rargs in
-		ctx.fun_pargs <- (ctx.code_pos, List.rev !pargs) :: ctx.fun_pargs;
-		List.iter (fun (v,c) ->
-			match c with
-			| None | Some TNull -> ()
-			| Some c -> gen_expr ctx false (Codegen.set_default ctx.com v c e.epos)
-		) f.tf_args;
-		if ctx.com.debug then begin
-			gen_expr ctx false (ctx.stack.Codegen.stack_push ctx.curclass (fst ctx.curmethod));
-			gen_expr ctx false ctx.stack.Codegen.stack_save_pos;
-			let start_try = gen_try ctx in
-			gen_expr ctx false (Codegen.stack_block_loop ctx.stack f.tf_expr);
-			gen_expr ctx false ctx.stack.Codegen.stack_pop;
-			let end_try = start_try() in
-			(* if $spos == 1 , then no upper call, so report as uncaught *)
-			getvar ctx (access_local ctx ctx.stack.Codegen.stack_pos_var);
-			push ctx [VInt 1];
-			write ctx AEqual;
-			write ctx ANot;
-			let j = cjmp ctx in
-			push ctx [VReg 0];
-			push ctx [VInt 1];
-			getvar ctx (gen_path ctx (["flash"],"Boot") ctx.extern_boot);
-			push ctx [VStr ("__exc",false)];
-			call ctx VarObj 1;
-			write ctx AReturn;
-			j();
-			push ctx [VReg 0];
-			write ctx AThrow;
-			end_try();
-		end else
-			gen_expr ctx false f.tf_expr;
-		ctx.in_loop <- old_in_loop;
-		ctx.curmethod <- old_meth;
-		tf();
-		block();
-	| TIf (cond,e,None) ->
-		if retval then assert false;
-		gen_expr ctx true cond;
-		write ctx ANot;
-		let j = cjmp ctx in
-		gen_expr ctx retval e;
-		j()
-	| TIf (cond,e,Some e2) ->
-		gen_expr ctx true cond;
-		let j = cjmp ctx in
-		gen_expr ctx retval e2;
-		let jend = jmp ctx in
-		j();
-		gen_expr ctx retval e;
-		if retval then ctx.stack_size <- ctx.stack_size - 1;
-		jend()
-	| TWhile (cond,e,Ast.NormalWhile) ->
-		let loop_end = begin_loop ctx in
-		let cont_pos = ctx.code_pos in
-		let loop = pos ctx in
-		gen_expr ctx true cond;
-		write ctx ANot;
-		let jend = cjmp ctx in
-		gen_expr ctx false e;
-		loop false;
-		jend();
-		loop_end cont_pos
-	| TWhile (cond,e,Ast.DoWhile) ->
-		let loop_end = begin_loop ctx in
-		let p = pos ctx in
-		gen_expr ctx false e;
-		let cont_pos = ctx.code_pos in
-		gen_expr ctx true cond;
-		p true;
-		loop_end cont_pos
-	| TReturn None ->
-		pop ctx (ctx.stack_size - ctx.fun_stack) false;
-		write ctx (APush [PUndefined]);
-		write ctx AReturn;
-		no_value ctx retval
-	| TReturn (Some e) ->
-		pop ctx (ctx.stack_size - ctx.fun_stack) false;
-		gen_expr ctx true e;
-		write ctx AReturn;
-		no_value ctx retval
-	| TBreak ->
-		pop ctx (ctx.stack_size - ctx.loop_stack) false;
-		ctx.breaks <- jmp ctx :: ctx.breaks;
-		no_value ctx retval
-	| TContinue ->
-		pop ctx (ctx.stack_size - ctx.loop_stack) false;
-		ctx.continues <- jmp_pos ctx false :: ctx.continues;
-		no_value ctx retval
-	| TCall (e,el) ->
-		gen_call ctx e el
-	| TNew (c,_,el) ->
-		let nargs = List.length el in
-		List.iter (gen_expr ctx true) (List.rev el);
-		push ctx [VInt nargs];
-		let acc = gen_path ctx c.cl_path c.cl_extern in
-		new_call ctx acc nargs
-	| TSwitch (e,cases,def) ->
-		gen_switch ctx retval e cases def
-	| TThrow e ->
-		gen_expr ctx true e;
-		write ctx AThrow;
-		no_value ctx retval
-	| TTry (e,catchs) ->
-		gen_try_catch ctx retval e catchs
-	| TBinop (op,e1,e2) ->
-		gen_binop ctx retval op e1 e2
-	| TUnop (op,flag,e) ->
-		gen_unop ctx retval op flag e
-	| TCast (e,None) ->
-		gen_expr ctx retval e
-	| TCast (e1,Some t) ->
-		gen_expr ctx retval (Codegen.default_cast ctx.com e1 t e.etype e.epos)
-	| TFor (v,it,e) ->
-		gen_expr ctx true it;
-		let r = alloc_tmp ctx in
-		set_tmp ctx r;
-		write ctx APop;
-		let loop_end = begin_loop ctx in
-		let cont_pos = ctx.code_pos in
-		let j_begin = pos ctx in
-		push ctx [VInt 0];
-		get_tmp ctx r;
-		push ctx [VStr ("hasNext",false)];
-		call ctx VarObj 0;
-		write ctx ANot;
-		let j_end = cjmp ctx in
-		let b = open_block ctx in
-		define_var ctx v (Some (fun() ->
-			push ctx [VInt 0];
-			get_tmp ctx r;
-			push ctx [VStr ("next",false)];
-			call ctx VarObj 0;
-		));
-		gen_expr ctx false e;
-		j_begin false;
-		j_end();
-		loop_end cont_pos;
-		if retval then getvar ctx (access_local ctx v.v_name);
-		b();
-		free_tmp ctx r null_pos
-
-and gen_expr ctx retval e =
-	let old = ctx.stack_size in
-	gen_expr_2 ctx retval e;
-	if old <> ctx.stack_size then begin
-		if old + 1 <> ctx.stack_size then stack_error e.epos;
-		if not retval then write ctx APop;
-	end else if retval then stack_error e.epos
-
-let gen_class_static_field ctx c flag f =
-	match f.cf_expr with
-	| None ->
-		push ctx [VReg 0; VStr (f.cf_name,flag); VNull];
-		setvar ctx VarObj
-	| Some e ->
-		match e.eexpr with
-		| TFunction _ ->
-			push ctx [VReg 0; VStr (f.cf_name,flag)];
-			ctx.curmethod <- (f.cf_name,false);
-			gen_expr ctx true e;
-			setvar ctx VarObj
-		| _ ->
-			ctx.statics <- (c,flag,f.cf_name,e) :: ctx.statics
-
-let gen_class_static_init ctx (c,flag,name,e) =
-	ctx.curclass <- c;
-	ctx.curmethod <- (name,false);
-	getvar ctx (gen_path ctx c.cl_path c.cl_extern);
-	push ctx [VStr (name,flag)];
-	gen_expr ctx true e;
-	setvar ctx VarObj
-
-let gen_class_field ctx flag f =
-	push ctx [VReg 1; VStr (f.cf_name,flag)];
-	(match f.cf_expr with
-	| None ->
-		push ctx [VNull]
-	| Some e ->
-		ctx.curmethod <- (f.cf_name,false);
-		gen_expr ctx true e);
-	setvar ctx VarObj
-
-let gen_enum_field ctx e f =
-	push ctx [VReg 0; VStr (f.ef_name,false)];
-	(match follow f.ef_type with
-	| TFun (args,r) ->
-		ctx.regs <- PMap.empty;
-		ctx.reg_count <- 1;
-		let no_reg = ctx.flash6 in
-		let rargs = List.map (fun (n,_,_) -> if no_reg then 0, n else alloc_reg ctx , "") args in
-		let nregs = List.length rargs + 2 in
-		let tf = begin_func ctx false false rargs in
-		List.iter (fun (r,name) ->
-			if no_reg then begin
-				push ctx [VStr (name,false)];
-				write ctx AEval;
-			end else
-				push ctx [VReg r]
-		) (List.rev rargs);
-		push ctx [VInt f.ef_index; VStr (f.ef_name,false)];
-		init_array ctx nregs;
-		write ctx ADup;
-		write ctx ADup;
-		push ctx [VStr ("__enum__",false); VThis];
-		write ctx AObjSet;
-		push ctx [VStr ("toString",false); VStr ("@estr",false)];
-		write ctx AEval;
-		write ctx AObjSet;
-		write ctx AReturn;
-		tf();
-	| t ->
-		push ctx [VInt f.ef_index; VStr (f.ef_name,false)];
-		init_array ctx 2;
-		write ctx ADup;
-		write ctx ADup;
-		push ctx [VStr ("__enum__",false); VReg 0];
-		write ctx AObjSet;
-		push ctx [VStr ("toString",false); VStr ("@estr",false)];
-		write ctx AEval;
-		write ctx AObjSet;
-	);
-	write ctx AObjSet
-
-let init_name ctx path enum =
-	push ctx [VReg 0; VStr ((if enum then "__ename__" else "__name__"),false)];
-	let name = fst path @ [snd path] in
-	push ctx (List.map (fun s -> VStr (s,false)) (List.rev name));
-	init_array ctx (List.length name);
-	setvar ctx VarObj
-
-let gen_package ctx path ext =
-	let rec loop acc = function
-		| [] -> ()
-		| x :: l ->
-			let p = x :: acc in
-			if not (Hashtbl.mem ctx.packages p) then begin
-				(* create the package and copy the _global one if exists *)
-				Hashtbl.add ctx.packages p ();
-
-				(* create the package *)
-				let path = (List.rev acc,x) in
-				let acc = gen_path ctx path false in
-				push ctx [VInt 0; VStr ("Object",true)];
-				write ctx ANew;
-				write ctx (ASetReg 1);
-				setvar ctx acc;
-
-				(* copy the content of the _global package if exists *)
-				getvar ctx (gen_path ctx ~protect:true ("_global" :: fst path,snd path) ext);
-				write ctx (ASetReg 2);
-				write ctx AEnum2;
-				ctx.stack_size <- ctx.stack_size + 1; (* fake *)
-				let back = pos ctx in
-				write ctx (ASetReg 0);
-				push ctx [VNull];
-				write ctx AEqual;
-				let jend = cjmp ctx in
-				push ctx [VReg 1; VReg 0];
-				push ctx [VReg 2; VReg 0];
-				write ctx AObjGet;
-				write ctx AObjSet;
-				back false;
-				jend();
-
-				write ctx APop;
-			end;
-			loop p l
-	in
-	loop [] (fst path)
-
-let gen_type_def ctx t =
-	if ctx.ident_size > 50000 then segment ctx;
-	match t with
-	| TClassDecl c ->
-		(match c.cl_init with
-		| None -> ()
-		| Some e -> ctx.inits <- e :: ctx.inits);
-		gen_package ctx c.cl_path c.cl_extern;
-		if c.cl_extern then
-			()
-		else
-		let have_constr = ref false in
-		if c.cl_path = (["flash"] , "Boot") then ctx.extern_boot <- false;
-		let acc = gen_path ctx c.cl_path false in
-		let rec loop s =
-			match s.cl_super with
-			| None -> ()
-			| Some (s,_) ->
-				if s.cl_path = (["flash"],"MovieClip") then
-					ctx.movieclips <- c.cl_path :: ctx.movieclips
-				else
-					loop s
-		in
-		loop c;
-		ctx.curclass <- c;
-		(match c.cl_constructor with
-		| Some { cf_expr = Some e } ->
-			have_constr := true;
-			ctx.curmethod <- ("new",false);
-			gen_expr ctx true e
-		| _ ->
-			let f = begin_func ctx true false [] in
-			f());
-		write ctx (ASetReg 0);
-		setvar ctx acc;
-		init_name ctx c.cl_path false;
-		(match c.cl_super with
-		| None -> ()
-		| Some (csuper,_) ->
-			let path = (match csuper.cl_path with (["flash"],x) when csuper.cl_extern -> (["_global"],x) | p -> p) in
-			push ctx [VReg 0; VStr ("__super__",false)];
-			getvar ctx (gen_path ctx path csuper.cl_extern);
-			setvar ctx VarObj;
-			if ctx.flash6 then begin
-				(* myclass.prototype.__proto__ = superclass.prototype *)
-				push ctx [VReg 0; VStr ("prototype",true)];
-				getvar ctx VarObj;
-				push ctx [VStr ("__proto__",true)];
-				getvar ctx (gen_path ctx path csuper.cl_extern);
-				push ctx [VStr ("prototype",true)];
-				getvar ctx VarObj;
-				setvar ctx VarObj;
-				(* myclass.prototype.__constructor__ = superclass *)
-				push ctx [VReg 0; VStr ("prototype",true)];
-				getvar ctx VarObj;
-				push ctx [VStr ("__constructor__",true)];
-				getvar ctx (gen_path ctx path csuper.cl_extern);
-				setvar ctx VarObj
-			end else begin
-				push ctx [VReg 0];
-				getvar ctx (gen_path ctx path csuper.cl_extern);
-				write ctx AExtends;
-			end;
-		);
-		(match c.cl_implements with
-		| [] -> ()
-		| l ->
-			let nimpl = List.length l in
-			push ctx [VReg 0; VStr ("__interfaces__",false)];
-			List.iter (fun (c,_) -> getvar ctx (gen_path ctx c.cl_path c.cl_extern)) l;
-			init_array ctx nimpl;
-			setvar ctx VarObj;
-			if not ctx.flash6 then begin
-				List.iter (fun (c,_) -> getvar ctx (gen_path ctx c.cl_path c.cl_extern)) l;
-				push ctx [VInt nimpl; VReg 0];
-				write ctx AImplements;
-				ctx.stack_size <- ctx.stack_size - nimpl;
-			end);
-		push ctx [VReg 0; VStr ("prototype",true)];
-		getvar ctx VarObj;
-		write ctx (ASetReg 1);
-		write ctx APop;
-		push ctx [VReg 1; VStr ("__class__",false); VReg 0];
-		setvar ctx VarObj;
-		(* true if implements mt.Protect *)
-		let flag = is_protected ctx ~stat:true (TInst (c,[])) "" in
-		if (Common.has_feature ctx.com "Reflect.getProperty") || (Common.has_feature ctx.com "Reflect.setProperty") then
-			Codegen.add_property_field ctx.com c;
-		List.iter (fun f -> if not (is_extern_field f) then gen_class_static_field ctx c flag f) c.cl_ordered_statics;
-		let flag = is_protected ctx (TInst (c,[])) "" in
-		PMap.iter (fun _ f -> if not (is_extern_field f) then gen_class_field ctx flag f) c.cl_fields;
-	| TEnumDecl e when e.e_extern ->
-		()
-	| TEnumDecl e ->
-		gen_package ctx e.e_path e.e_extern;
-		let acc = gen_path ctx e.e_path false in
-		push ctx [VInt 0; VStr ("Object",true)];
-		write ctx ANew;
-		write ctx (ASetReg 0);
-		setvar ctx acc;
-		init_name ctx e.e_path true;
-		push ctx [VReg 0; VStr ("__constructs__",true)];
-		List.iter (fun s -> push ctx [VStr (s,false)]) (List.rev e.e_names);
-		init_array ctx (List.length e.e_names);
-		write ctx AObjSet;
-		(match Codegen.build_metadata ctx.com t with
-		| None -> ()
-		| Some e ->
-			push ctx [VReg 0; VStr ("__meta__",true)];
-			gen_expr ctx true e;
-			write ctx AObjSet;
-		);
-		PMap.iter (fun _ f -> gen_enum_field ctx e f) e.e_constrs
-	| TTypeDecl _ | TAbstractDecl _ ->
-		()
-
-let gen_boot ctx =
-	(* r0 = Boot *)
-	getvar ctx (gen_path ctx (["flash"],"Boot") ctx.extern_boot);
-	write ctx (ASetReg 0);
-	write ctx APop;
-	(* r0.__init(eval("this")) *)
-	push ctx [VStr ("this",true)];
-	write ctx AEval;
-	push ctx [VInt 1; VReg 0; VStr ("__init",false)];
-	call ctx VarObj 0;
-	write ctx APop
-
-let gen_movieclip ctx m =
-	getvar ctx (gen_path ctx m false);
-	push ctx [VStr (s_type_path m,true); VInt 2; VStr ("Object",true)];
-	write ctx AEval;
-	push ctx [VStr ("registerClass",true)];
-	call ctx VarObj 2;
-	write ctx APop
-
-let to_utf8 str =
-	try
-		UTF8.validate str;
-		str;
-	with
-		UTF8.Malformed_code ->
-			let b = UTF8.Buf.create 0 in
-			String.iter (fun c -> UTF8.Buf.add_char b (UChar.of_char c)) str;
-			UTF8.Buf.contents b
-
-let build_tag (opcodes,idents) =
-	let idents = Hashtbl.fold (fun ident pos acc -> (ident,pos) :: acc) idents [] in
-	let idents = List.sort (fun (_,p1) (_,p2) -> compare p1 p2) idents in
-	let pidents = List.map (fun ((_,flag),_) -> flag) idents in
-	let idents = AStringPool (List.map (fun ((id,_),_) -> to_utf8 id) idents) in
-	if ActionScript.action_length idents >= 1 lsl 16 then failwith "The SWF can't handle more than a total size of 64K of identifers and literal strings. Try reducing this number by using external data files loaded at runtime";
-	DynArray.set opcodes 0 idents;
-	TDoAction opcodes , pidents
-
-let convert_header ctx ver (w,h,fps,bg) =
-	{
-		h_version = ver;
-		h_size = {
-			rect_nbits = if (max w h) >= 820 then 16 else 15;
-			left = 0;
-			top = 0;
-			right = w * 20;
-			bottom = h * 20;
-		};
-		h_frame_count = 1;
-		h_fps = to_float16 (if fps > 127.0 then 127.0 else fps);
-		h_compressed = not (Common.defined ctx Define.NoSwfCompress);
-	} , bg
-
-let default_header ctx ver =
-	convert_header ctx ver (400,300,30.,0xFFFFFF)
-
-let generate com =
-	let ctx = {
-		com = com;
-		stack = Codegen.stack_init com true;
-		flash6 = com.flash_version = 6.;
-		segs = [];
-		opcodes = DynArray.create();
-		code_pos = 0;
-		stack_size = 0;
-		ident_count = 0;
-		ident_size = 0;
-		opt_push = false;
-		idents = Hashtbl.create 0;
-		packages = Hashtbl.create 0;
-		regs = PMap.empty;
-		reg_count = 0;
-		reg_max = 0;
-		breaks = [];
-		continues = [];
-		loop_stack = 0;
-		fun_stack = 0;
-		statics = [];
-		movieclips = [];
-		inits = [];
-		curclass = null_class;
-		curmethod = ("",false);
-		fun_pargs = [];
-		in_loop = false;
-		static_init = false;
-		extern_boot = true;
-	} in
-	write ctx (AStringPool []);
-	protect_all := not (Common.defined com Define.SwfMark);
-	if com.debug then begin
-		push ctx [VStr (ctx.stack.Codegen.stack_var,false); VInt 0];
-		write ctx AInitArray;
-		write ctx ASet;
-		push ctx [VStr (ctx.stack.Codegen.stack_exc_var,false); VInt 0];
-		write ctx AInitArray;
-		write ctx ASet;
-	end;
-	(* ----- @estr = function() { return flash.Boot.__string_rec(this,""); } ---- *)
-	push ctx [VStr ("@estr",false)];
-	ctx.reg_count <- 1;
-	let f = begin_func ctx false false [] in
-	push ctx [VStr ("xx",false); VThis; VInt 2];
-	getvar ctx (gen_path ctx (["flash"],"Boot") false);
-	push ctx [VStr ("__string_rec",false)];
-	call ctx VarObj 2;
-	write ctx AReturn;
-	f();
-	write ctx ASet;
-	ctx.reg_count <- 0;
-	(* ---- *)
-	List.iter (fun t -> gen_type_def ctx t) com.types;
-	gen_boot ctx;
-	List.iter (fun m -> gen_movieclip ctx m) ctx.movieclips;
-	ctx.static_init <- true;
-	List.iter (gen_expr ctx false) (List.rev ctx.inits);
-	let global_try = gen_try ctx in
-	List.iter (gen_class_static_init ctx) (List.rev ctx.statics);
-	(match com.main with
-	| None -> ()
-	| Some e -> gen_expr ctx false e);
-	ctx.static_init <- false;
-	let end_try = global_try() in
-	(* flash.Boot.__trace(exc) *)
-	push ctx [VReg 0; VInt 1];
-	getvar ctx (gen_path ctx (["flash"],"Boot") ctx.extern_boot);
-	push ctx [VStr ("__exc",false)];
-	call ctx VarObj 1;
-	write ctx APop;
-	end_try();
-	let segs = List.rev ((ctx.opcodes,ctx.idents) :: ctx.segs) in
-	let tags = List.map build_tag segs in
-	if Common.defined com Define.SwfMark then begin
-		if List.length segs > 1 then assert false;
-		let pidents = snd (List.hd tags) in
-		let ch = IO.output_channel (open_out_bin (Filename.chop_extension com.file ^ ".mark")) in
-		IO.write_i32 ch (List.length ctx.fun_pargs);
-		List.iter (fun (id,l) ->
-			IO.write_i32 ch id;
-			IO.write_i32 ch (List.length l);
-			List.iter (fun f -> IO.write_byte ch (if f then 1 else 0)) l;
-		) ctx.fun_pargs;
-		IO.write_i32 ch (List.length pidents);
-		List.iter (fun f -> IO.write_byte ch (if f then 1 else 0)) pidents;
-		IO.close_out ch;
-	end;
-	List.map fst tags , ctx.movieclips

+ 11 - 1
genswf9.ml

@@ -627,6 +627,16 @@ let debug_infos ?(is_min=true) ctx p =
 		end
 		end
 	end
 	end
 
 
+let to_utf8 str =
+	try
+		UTF8.validate str;
+		str;
+	with
+		UTF8.Malformed_code ->
+			let b = UTF8.Buf.create 0 in
+			String.iter (fun c -> UTF8.Buf.add_char b (UChar.of_char c)) str;
+			UTF8.Buf.contents b
+
 let gen_constant ctx c t p =
 let gen_constant ctx c t p =
 	match c with
 	match c with
 	| TInt i ->
 	| TInt i ->
@@ -640,7 +650,7 @@ let gen_constant ctx c t p =
 		let f = float_of_string f in
 		let f = float_of_string f in
 		write ctx (HFloat f);
 		write ctx (HFloat f);
 	| TString s ->
 	| TString s ->
-		write ctx (HString (Genswf8.to_utf8 s));
+		write ctx (HString (to_utf8 s));
 	| TBool b ->
 	| TBool b ->
 		write ctx (if b then HTrue else HFalse);
 		write ctx (if b then HTrue else HFalse);
 	| TNull ->
 	| TNull ->

+ 16 - 26
main.ml

@@ -168,7 +168,7 @@ let htmlescape s =
 	s
 	s
 
 
 let reserved_flags = [
 let reserved_flags = [
-	"cross";"flash8";"js";"neko";"flash";"php";"cpp";"cs";"java";"python";
+	"cross";"js";"neko";"flash";"php";"cpp";"cs";"java";"python";
 	"as3";"swc";"macro";"sys"
 	"as3";"swc";"macro";"sys"
 	]
 	]
 
 
@@ -1031,7 +1031,7 @@ try
 		if com.platform <> Cross then failwith "Multiple targets";
 		if com.platform <> Cross then failwith "Multiple targets";
 		Common.init_platform com pf;
 		Common.init_platform com pf;
 		com.file <- file;
 		com.file <- file;
-		if (pf = Flash8 || pf = Flash) && file_extension file = "swc" then Common.define com Define.Swc;
+		if (pf = Flash) && file_extension file = "swc" then Common.define com Define.Swc;
 	in
 	in
 	let define f = Arg.Unit (fun () -> Common.define com f) in
 	let define f = Arg.Unit (fun () -> Common.define com f) in
 	let process_ref = ref (fun args -> ()) in
 	let process_ref = ref (fun args -> ()) in
@@ -1421,28 +1421,18 @@ try
 			(* no platform selected *)
 			(* no platform selected *)
 			set_platform Cross "";
 			set_platform Cross "";
 			"?"
 			"?"
-		| Flash8 | Flash ->
-			if com.flash_version >= 9. then begin
-				let rec loop = function
-					| [] -> ()
-					| (v,_) :: _ when v > com.flash_version -> ()
-					| (v,def) :: l ->
-						Common.raw_define com ("flash" ^ def);
-						loop l
-				in
-				loop Common.flash_versions;
-				Common.raw_define com "flash";
-				com.defines <- PMap.remove "flash8" com.defines;
-				com.package_rules <- PMap.remove "flash" com.package_rules;
-				add_std "flash";
-			end else begin
-				com.package_rules <- PMap.add "flash" (Directory "flash8") com.package_rules;
-				com.package_rules <- PMap.add "flash8" Forbidden com.package_rules;
-				Common.raw_define com "flash";
-				Common.raw_define com ("flash" ^ string_of_int (int_of_float com.flash_version));
-				com.platform <- Flash8;
-				add_std "flash8";
-			end;
+		| Flash ->
+			let rec loop = function
+				| [] -> ()
+				| (v,_) :: _ when v > com.flash_version -> ()
+				| (v,def) :: l ->
+					Common.raw_define com ("flash" ^ def);
+					loop l
+			in
+			loop Common.flash_versions;
+			Common.raw_define com "flash";
+			com.package_rules <- PMap.remove "flash" com.package_rules;
+			add_std "flash";
 			"swf"
 			"swf"
 		| Neko ->
 		| Neko ->
 			add_std "neko";
 			add_std "neko";
@@ -1549,10 +1539,10 @@ try
 			end;
 			end;
 		| Cross ->
 		| Cross ->
 			()
 			()
-		| Flash8 | Flash when Common.defined com Define.As3 ->
+		| Flash when Common.defined com Define.As3 ->
 			Common.log com ("Generating AS3 in : " ^ com.file);
 			Common.log com ("Generating AS3 in : " ^ com.file);
 			Genas3.generate com;
 			Genas3.generate com;
-		| Flash8 | Flash ->
+		| Flash ->
 			Common.log com ("Generating swf : " ^ com.file);
 			Common.log com ("Generating swf : " ^ com.file);
 			Genswf.generate com !swf_header;
 			Genswf.generate com !swf_header;
 		| Neko ->
 		| Neko ->

+ 1 - 17
std/Date.hx

@@ -124,17 +124,13 @@ extern class Date
 
 
 #if flash
 #if flash
 	private static function __init__() : Void untyped {
 	private static function __init__() : Void untyped {
-		var d #if !swf_mark : Dynamic #end = Date;
+		var d : Dynamic = Date;
 		d.now = function() {
 		d.now = function() {
 			return __new__(Date);
 			return __new__(Date);
 		};
 		};
 		d.fromTime = function(t){
 		d.fromTime = function(t){
 			var d : Date = __new__(Date);
 			var d : Date = __new__(Date);
-			#if flash9
 			d.setTime(t);
 			d.setTime(t);
-			#else
-			d["setTime"]( t );
-			#end
 			return d;
 			return d;
 		};
 		};
 		d.fromString = function(s : String) {
 		d.fromString = function(s : String) {
@@ -142,17 +138,10 @@ extern class Date
 			case 8: // hh:mm:ss
 			case 8: // hh:mm:ss
 				var k = s.split(":");
 				var k = s.split(":");
 				var d : Date = __new__(Date);
 				var d : Date = __new__(Date);
-				#if flash9
 				d.setTime(0);
 				d.setTime(0);
 				d.setUTCHours(k[0]);
 				d.setUTCHours(k[0]);
 				d.setUTCMinutes(k[1]);
 				d.setUTCMinutes(k[1]);
 				d.setUTCSeconds(k[2]);
 				d.setUTCSeconds(k[2]);
-				#else
-				d["setTime"](0);
-				d["setUTCHours"](k[0]);
-				d["setUTCMinutes"](k[1]);
-				d["setUTCSeconds"](k[2]);
-				#end
 				return d;
 				return d;
 			case 10: // YYYY-MM-DD
 			case 10: // YYYY-MM-DD
 				var k = s.split("-");
 				var k = s.split("-");
@@ -180,11 +169,6 @@ extern class Date
 				+":"+(if( mi < 10 ) "0"+mi else ""+mi)
 				+":"+(if( mi < 10 ) "0"+mi else ""+mi)
 				+":"+(if( s < 10 ) "0"+s else ""+s);
 				+":"+(if( s < 10 ) "0"+s else ""+s);
 		};
 		};
-		#if flash9
-		#elseif flash
-		d.prototype[__unprotect__("__class__")] = d;
-		d[__unprotect__("__name__")] = ["Date"];
-		#end
 	}
 	}
 #end
 #end
 }
 }

+ 4 - 10
std/Math.hx

@@ -230,7 +230,7 @@ extern class Math
 	**/
 	**/
 	static function random() : Float;
 	static function random() : Float;
 
 
-	#if ((flash9 && !as3) || cpp)
+	#if ((flash && !as3) || cpp)
 	/**
 	/**
 		Returns the largest integer value that is not greater than `v`, as a Float.
 		Returns the largest integer value that is not greater than `v`, as a Float.
 
 
@@ -290,7 +290,7 @@ extern class Math
 	static function isNaN( f : Float ) : Bool;
 	static function isNaN( f : Float ) : Bool;
 
 
 	private static function __init__() : Void untyped {
 	private static function __init__() : Void untyped {
-	#if flash9
+	#if flash
 		NaN = __global__["Number"].NaN;
 		NaN = __global__["Number"].NaN;
 		NEGATIVE_INFINITY = __global__["Number"].NEGATIVE_INFINITY;
 		NEGATIVE_INFINITY = __global__["Number"].NEGATIVE_INFINITY;
 		POSITIVE_INFINITY = __global__["Number"].POSITIVE_INFINITY;
 		POSITIVE_INFINITY = __global__["Number"].POSITIVE_INFINITY;
@@ -302,20 +302,16 @@ extern class Math
 	#end
 	#end
 		Math.isFinite = function(i) {
 		Math.isFinite = function(i) {
 			return
 			return
-			#if flash9
+			#if flash
 			__global__["isFinite"](i);
 			__global__["isFinite"](i);
-			#elseif flash
-			_global["isFinite"](i);
 			#else
 			#else
 			false;
 			false;
 			#end
 			#end
 		};
 		};
 		Math.isNaN = function(i) {
 		Math.isNaN = function(i) {
 			return
 			return
-			#if flash9
+			#if flash
 			__global__["isNaN"](i);
 			__global__["isNaN"](i);
-			#elseif flash
-			_global["isNaN"](i);
 			#else
 			#else
 			false;
 			false;
 			#end
 			#end
@@ -323,5 +319,3 @@ extern class Math
 	}
 	}
 
 
 }
 }
-
-

+ 1 - 1
std/StdTypes.hx

@@ -48,7 +48,7 @@
 
 
 /**
 /**
 	`Null` can be useful in two cases. In order to document some methods
 	`Null` can be useful in two cases. In order to document some methods
-	that accepts or can return a `null` value, or for the Flash9 compiler and AS3
+	that accepts or can return a `null` value, or for the Flash compiler and AS3
 	generator to distinguish between base values that can be null and others that
 	generator to distinguish between base values that can be null and others that
 	can't.
 	can't.
 **/
 **/

+ 5 - 13
std/StringTools.hx

@@ -37,10 +37,8 @@ class StringTools {
 		Encode an URL by using the standard format.
 		Encode an URL by using the standard format.
 	**/
 	**/
 	#if (!java && !cpp) inline #end public static function urlEncode( s : String ) : String {
 	#if (!java && !cpp) inline #end public static function urlEncode( s : String ) : String {
-		#if flash9
+		#if flash
 			return untyped __global__["encodeURIComponent"](s);
 			return untyped __global__["encodeURIComponent"](s);
-		#elseif flash
-			return untyped _global["escape"](s);
 		#elseif neko
 		#elseif neko
 			return untyped new String(_urlEncode(s.__s));
 			return untyped new String(_urlEncode(s.__s));
 		#elseif js
 		#elseif js
@@ -64,10 +62,8 @@ class StringTools {
 		Decode an URL using the standard format.
 		Decode an URL using the standard format.
 	**/
 	**/
 	#if (!java && !cpp) inline #end public static function urlDecode( s : String ) : String {
 	#if (!java && !cpp) inline #end public static function urlDecode( s : String ) : String {
-		#if flash9
+		#if flash
 			return untyped __global__["decodeURIComponent"](s.split("+").join(" "));
 			return untyped __global__["decodeURIComponent"](s.split("+").join(" "));
-		#elseif flash
-			return untyped _global["unescape"](s);
 		#elseif neko
 		#elseif neko
 			return untyped new String(_urlDecode(s.__s));
 			return untyped new String(_urlDecode(s.__s));
 		#elseif js
 		#elseif js
@@ -339,7 +335,7 @@ class StringTools {
 		its length equals `digits`.
 		its length equals `digits`.
 	**/
 	**/
 	public static function hex( n : Int, ?digits : Int ) {
 	public static function hex( n : Int, ?digits : Int ) {
-		#if flash9
+		#if flash
 			var n : UInt = n;
 			var n : UInt = n;
 			var s : String = untyped n.toString(16);
 			var s : String = untyped n.toString(16);
 			s = s.toUpperCase();
 			s = s.toUpperCase();
@@ -385,10 +381,8 @@ class StringTools {
 		return untyped __dollar__sget(s.__s, index);
 		return untyped __dollar__sget(s.__s, index);
 		#elseif cpp
 		#elseif cpp
 		return untyped s.cca(index);
 		return untyped s.cca(index);
-		#elseif flash9
-		return untyped s.cca(index);
 		#elseif flash
 		#elseif flash
-		return untyped s["cca"](index);
+		return untyped s.cca(index);
 		#elseif java
 		#elseif java
 		return ( index < s.length ) ? cast(_charAt(s, index), Int) : -1;
 		return ( index < s.length ) ? cast(_charAt(s, index), Int) : -1;
 		#elseif cs
 		#elseif cs
@@ -406,10 +400,8 @@ class StringTools {
 		Tells if `c` represents the end-of-file (EOF) character.
 		Tells if `c` represents the end-of-file (EOF) character.
 	*/
 	*/
 	@:noUsing public static inline function isEof( c : Int ) : Bool {
 	@:noUsing public static inline function isEof( c : Int ) : Bool {
-		#if (flash9 || cpp)
+		#if (flash || cpp)
 		return c == 0;
 		return c == 0;
-		#elseif flash8
-		return c <= 0; // fast NaN
 		#elseif js
 		#elseif js
 		return c != c; // fast NaN
 		return c != c; // fast NaN
 		#elseif neko
 		#elseif neko

+ 3 - 3
std/UInt.hx

@@ -20,9 +20,9 @@
  * DEALINGS IN THE SOFTWARE.
  * DEALINGS IN THE SOFTWARE.
  */
  */
 
 
-#if ((flash9 || flash9doc || cs) && !doc_gen)
+#if ((flash || flash9doc || cs) && !doc_gen)
 /**
 /**
-	The unsigned Int type is only defined for Flash9 and C#. It's currently
+	The unsigned Int type is only defined for Flash and C#. It's currently
 	handled the same as a normal Int.
 	handled the same as a normal Int.
 **/
 **/
 @:coreType
 @:coreType
@@ -92,7 +92,7 @@ abstract UInt to Int from Int
 }
 }
 #else
 #else
 /**
 /**
-	The unsigned Int type is only defined for Flash9 and C#.
+	The unsigned Int type is only defined for Flash and C#.
 	Simulate it for other platforms.
 	Simulate it for other platforms.
 **/
 **/
 abstract UInt(Int) from Int to Int {
 abstract UInt(Int) from Int to Int {

+ 0 - 13
std/flash8/Accessibility.hx

@@ -1,13 +0,0 @@
-package flash;
-
-extern class Accessibility
-{
-	static function isActive() : Bool;
-	static function updateProperties() : Void;
-	// ? not documented ?
-	static function sendEvent(mc : MovieClip, childID : Dynamic, event : Dynamic, isNonHtml : Bool) : Void;
-
-	private static function __init__() : Void untyped {
-		flash.Accessibility = _global["Accessibility"];
-	}
-}

+ 0 - 334
std/flash8/Boot.hx

@@ -1,334 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package flash;
-
-@:keep
-class Boot {
-
-	private static var def_color = 0;
-	private static var exception = null;
-
-	public static function __string_rec(o : Dynamic,s : String) {
-		untyped {
-			if( s.length >= 20 )
-				return "<...>"; // too much deep recursion
-			var t = __typeof__(o);
-			if( t == "movieclip" )
-				t = "object";
-			else if( t == "function" && (o.__name__ != null || o.__ename__ != null) )
-				t = "object";
-			switch( t ) {
-			case "object":
-				if( __instanceof__(o,Array) ) {
-					if( o.__enum__ != null ) {
-						if( o["length"] == 2 )
-							return o[0];
-						var str = o[0]+"(";
-						s += "    ";
-						for( i in 2...o["length"] ) {
-							if( i != 2 )
-								str += "," + __string_rec(o[i],s);
-							else
-								str += __string_rec(o[i],s);
-						}
-						return str + ")";
-					}
-					var l = o["length"];
-					var i;
-					var str = "[";
-					s += "    ";
-					for( i in 0...l )
-						str += (if (i > 0) "," else "")+__string_rec(o[i],s);
-					str += "]";
-					return str;
-				}
-				var s2 = o["toString"]();
-				if( (__typeof__(s2) == "string" || __instanceof__(s2,String)) && s2 != "[object Object]" && s2 != "[type Function]" )
-					return s2;
-				var k;
-				var str = "{\n";
-				if( typeof(o) == "movieclip" )
-					str = "MC("+o._name+") "+str;
-				s += "    ";
-				var keys : Array<String> = __keys__(o);
-				for( k in keys.iterator() ) {
-					if( k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" )
-						continue;
-					if( str.length != 2 )
-						str += ",\n";
-					str += s + k + " : "+__string_rec(o[k],s);
-				}
-				s = s.substring(4);
-				if( str.length != 2 )
-					str += "\n";
-				str += s + "}";
-				return str;
-			case "function":
-				return "<function>";
-			case "string":
-				return o;
-			default:
-				return String(o);
-			}
-		}
-	}
-
-	private static function __closure(f,o) {
-		untyped {
-			var m = o[f];
-			if( m == null )
-				return null;
-			var f2 = function() {
-				var me = __arguments__["callee"];
-				return me["f"]["apply"](me["o"],__arguments__);
-			};
-			f2["f"] = m;
-			f2["o"] = o;
-			return f2;
-		}
-	}
-
-	#if flash6
-	private static function __interfLoop(cc : Dynamic,cl : Dynamic) {
-		if( cc == null )
-			return false;
-		var intf : Array<Dynamic> = cc.__interfaces__;
-		for( i in 0...intf.length ) {
-			var i = intf[i];
-			if( i == cl || __interfLoop(i,cl) )
-				return true;
-		}
-		return __interfLoop(cc.__super__,cl);
-	}
-	#end
-
-	private static function __instanceof(o : Dynamic,cl) {
-		untyped {
-			if( !cl )
-				return false;
-			if( __instanceof__(o,cl) ) {
-				if( cl == Array )
-					return ( o[__unprotect__("__enum__")] == null );
-				return true;
-			}
-			#if flash6
-			if( __interfLoop(o[__unprotect__("__class__")],cl) )
-				return true;
-			#end
-			switch( cast cl ) {
-			case Int:
-				return __typeof__(o) == "number" && __physeq__(Math.ceil(o),o%2147483648.0) && !(__physeq__(o,true) || __physeq__(o,false));
-			case Float:
-				return __typeof__(o) == "number";
-			case Bool:
-				return __physeq__(o,true) || __physeq__(o,false);
-			case String:
-				return __typeof__(o) == "string";
-			case Dynamic:
-				return true;
-			default:
-				return o[__unprotect__("__enum__")] == cl ||
-					(cl == Class && o[__unprotect__("__name__")] != null) ||
-					(cl == Enum && o[__unprotect__("__ename__")] != null);
-			}
-		}
-	}
-
-	private static function getTrace() : flash.TextField untyped {
-		var root = flash.Lib.current;
-		var tf : flash.TextField = root.__trace_txt;
-		if( tf == null ) {
-			var w = Stage.width, h = Stage.height;
-			if( w == 0 ) w = 800;
-			if( h == 0 ) h = 600;
-			root.createTextField("__trace_txt",1048500,0,0,w,h+30);
-			tf = root.__trace_txt;
-			var format = tf.getTextFormat();
-			format.font = "_sans";
-			tf.setNewTextFormat(format);
-			tf.selectable = false;
-			tf.textColor = def_color;
-			root.__trace_lines = new Array<String>();
-		}
-		return tf;
-	}
-
-	private static function __set_trace_color( rgb : Int ) {
-		getTrace().textColor = rgb;
-		def_color = rgb;
-	}
-
-	private static function __trace(v,inf : haxe.PosInfos) {
-		untyped {
-			var root = flash.Lib.current;
-			var tf = getTrace();
-			var s = inf.fileName+(if( inf.lineNumber == null ) "" else ":"+inf.lineNumber)+": "+__string_rec(v, "");
-			if( inf != null && inf.customParams != null )
-				for( v in inf.customParams )
-					s += "," + __string_rec(v, "");
-			var lines : Array<String> = root.__trace_lines["concat"](s.split("\n"));
-			tf.text = lines.join("\n");
-			while( lines.length > 1 && tf.textHeight > Stage.height ) {
-				lines.shift();
-				tf.text = lines.join("\n");
-			}
-			root.__trace_lines = lines;
-		}
-	}
-
-	static function __exc(v) {
-		var s = "";
-		#if debug
-		var a : Array<String> = untyped __eval__("$s");
-		for( i in 0...a.length-1 )
-			s += "\nCalled from "+a[i];
-		var old = a.slice(0,a.length-1);
-		a.splice(0,a.length);
-		#end
-		if( untyped Lib.onerror != null )
-			untyped Lib.onerror(__string_rec(v,""),#if debug old #else [] #end);
-		else
-			__trace(__string_rec(v,"")+s,cast { fileName : "(uncaught exception)" });
-	}
-
-	private static function __clear_trace() {
-		untyped {
-			var root = flash.Lib.current;
-			root.__trace_txt["removeTextField"]();
-			root.__trace_lines = null;
-		}
-	}
-
-	private static function __init(current : Dynamic) untyped {
-		// only if not set yet
-		var g : Dynamic = _global;
-		if( !g.haxeInitDone ) {
-			g.haxeInitDone = true;
-			Array.prototype["copy"] = Array.prototype["slice"];
-			var splice:Dynamic = Array.prototype["splice"];
-			Array.prototype["splice"] = function(p, l) {
-				if (l <= 0) return [];
-				return splice.call(__this__, p, l);
-			}
-			Array.prototype["insert"] = function(i,x) {
-				splice.call(__this__, i, 0, x);
-			};
-			Array.prototype["remove"] = function(obj) {
-				var i = 0;
-				var l = __this__["length"];
-				while( i < l ) {
-					if( __this__[i] == obj ) {
-						__this__["splice"](i,1);
-						return true;
-					}
-					i++;
-				}
-				return false;
-			}
-			Array.prototype["indexOf"] = function(x, ?fromIndex) {
-				var len = __this__["length"], i = (fromIndex == null) ? 0 : fromIndex;
-				if (i < 0) {
-					i += len;
-					if (i < 0) i = 0;
-				}
-				while (i < len)
-				{
-					if (__this__[i] == x)
-						return i;
-					i++;
-				}
-				return -1;
-			}
-			Array.prototype["lastIndexOf"] = function(x, ?fromIndex) {
-				var len = __this__["length"], i = (fromIndex == null) ? len - 1 : fromIndex;
-				if (i >= len)
-					i = len - 1;
-				else if (i < 0)
-					i += len;
-				while (i >= 0)
-				{
-					if (__this__[i] == x)
-						return i;
-					i--;
-				}
-				return -1;
-			}
-			Array.prototype["iterator"] = function() {
-				return {
-					cur : 0,
-					arr : __this__,
-					hasNext : function() {
-						return __this__.cur < __this__.arr["length"];
-					},
-					next : function() {
-						return __this__.arr[__this__.cur++];
-					}
-				}
-			};
-			Array.prototype["map"] = function(f) {
-				var ret = [];
-				var i = 0;
-				var l = __this__["length"];
-				while( i < l ) {
-					ret.push(f(__this__[i]));
-					i++;
-				}
-				return ret;
-			};
-			Array.prototype["filter"] = function(f) {
-				var ret = [];
-				var i = 0;
-				var l = __this__["length"];
-				while ( i < l ) {
-					if (f(__this__[i]))
-						ret.push(__this__[i]);
-					i++;
-				}
-				return ret;
-			};
-			_global["ASSetPropFlags"](Array.prototype,null,7);
-			var cca = String.prototype["charCodeAt"];
-			String.prototype["cca"] = cca;
-			String.prototype["charCodeAt"] = function(i) {
-				var x = __this__["cca"](i);
-				if( x <= 0 ) // fast NaN
-					return null;
-				return x;
-			};
-			// create flash package (in for FP7 mark support)
-			if( _global["flash"] == null )
-				_global["flash"] = {};
-		}
-		// set the Lib variables
-		current.flash.Lib._global = _global;
-		current.flash.Lib._root = _root;
-		current.flash.Lib.current = current;
-		// prevent closure creation by setting untyped
-		current[__unprotect__("@instanceof")] = flash.Boot[__unprotect__("__instanceof")];
-		current[__unprotect__("@closure")] = flash.Boot[__unprotect__("__closure")];
-		// fix firefox default alignement
-		if( _global["Stage"]["align"] == "" )
-			_global["Stage"]["align"] = "LT";
-		#if mt mt.flash.Init.check(); #end
-	}
-
-}

+ 0 - 58
std/flash8/Button.hx

@@ -1,58 +0,0 @@
-package flash;
-
-extern class Button #if !flash_strict implements Dynamic #end {
-
-	var _alpha : Float;
-	var enabled : Bool;
-	var _focusrect : Bool;
-	var _height : Float;
-	var _highquality : Int; //Deprecated
-	var menu : ContextMenu;
-	var _name : String;
-	var _parent : MovieClip;
-	var _quality : String;
-	var _rotation : Float;
-	var _soundbuftime : Float;
-	var tabEnabled : Bool;
-	var tabIndex : Int;
-	var _target : String;
-	var trackAsMenu : Bool;
-	var _url : String;
-	var useHandCursor : Bool;
-	var _visible : Bool;
-	var _width : Float;
-	var _x : Float;
-	var _xmouse : Float;
-	var _xscale : Float;
-	var _y : Float;
-	var _ymouse : Float;
-	var _yscale : Float;
-
-	dynamic function onDragOut() : Void;
-	dynamic function onDragOver() : Void;
-	dynamic function onKeyDown() : Void;
-	dynamic function onKeyUp() : Void;
-	dynamic function onKillFocus(newFocus : Dynamic) : Void;
-	dynamic function onPress() : Void;
-	dynamic function onRelease() : Void;
-	dynamic function onReleaseOutside() : Void;
-	dynamic function onRollOut() : Void;
-	dynamic function onRollOver() : Void;
-	dynamic function onSetFocus(oldFocus : Dynamic) : Void;
-
-	function getDepth() : Int;
-
-#if flash8
-	var filters : Array<Dynamic>;
-	var blendMode : Dynamic;
-	var cacheAsBitmap : Bool;
-	var scale9Grid : flash.geom.Rectangle<Float>;
-#end
-
-	private static function __init__() : Void untyped {
-		flash.Button = _global["Button"];
-	}
-
-}
-
-

+ 0 - 42
std/flash8/Camera.hx

@@ -1,42 +0,0 @@
-package flash;
-
-extern class Camera {
-
-	static var names(default,null) : Array<String>;
-	static function get( ?index : Int ) : Camera;
-
-	var bandwidth(default,null) : Int;
-
-	var fps(default,null) : Float;
-	var currentFps(default,null) : Float;
-
-	var width(default,null) : Int;
-	var height(default,null) : Int;
-
-	var index(default,null) : Int;
-
-	var activityLevel(default,null) : Float;
-	var motionLevel(default,null) : Float;
-
-	var muted(default,null) : Bool;
-	var name(default,null) : String;
-
-	var quality(default,null) : Int;
-	var keyFrameInterval(default,null) : Int;
-	var loopback(default,null) : Bool;
-	var motionTimeOut(default,null) : Float;
-
-	function setMode( width:Int, height:Int, ?fps:Float, ?favorArea:Bool ):Void;
-	function setMotionLevel( motionLevel:Float , ?timeOut:Float ):Void;
-	function setQuality( bandwidth:Int, ?quality:Int ):Void;
-	function setKeyFrameInterval(keyFrameInterval:Int):Void;
-	function setLoopback(compress:Bool):Void;
-
-	dynamic function onActivity( active:Bool ):Void;
-	dynamic function onStatus( infoObject:Dynamic ):Void;
-
-	private static function __init__() : Void untyped {
-		flash.Camera = _global["Camera"];
-	}
-
-}

+ 0 - 35
std/flash8/Color.hx

@@ -1,35 +0,0 @@
-package flash;
-
-#if flash_strict
-typedef ColorTransform = {
-	var ra : Float;
-	var rb : Float;
-	var ga : Float;
-	var gb : Float;
-	var ba : Float;
-	var bb : Float;
-	var aa : Float;
-	var ab : Float;
-}
-#end
-
-extern class Color {
-
-	function new(target : MovieClip) : Void;
-
-	function setRGB(color:Int):Void;
-	function getRGB():Int;
-
-#if flash_strict
-	function setTransform(transformObject:ColorTransform):Void;
-	function getTransform():ColorTransform;
-#else
-	function setTransform(transformObject:Dynamic):Void;
-	function getTransform() : { ra : Float, rb : Float, ga : Float, gb : Float, ba : Float, bb : Float, aa : Float, ab : Float };
-#end
-
-	private static function __init__() : Void untyped {
-		flash.Color = _global["Color"];
-	}
-
-}

+ 0 - 15
std/flash8/ContextMenu.hx

@@ -1,15 +0,0 @@
-package flash;
-
-extern class ContextMenu {
-	function new( ?callb:Dynamic->ContextMenu->Void ) : Void;
-	function hideBuiltInItems():Void;
-	function copy() : ContextMenu;
-
-	var customItems:Array<ContextMenuItem>;
-	var builtInItems:Dynamic;
-	dynamic function onSelect( v : Dynamic, c : ContextMenu ) : Void;
-
-	private static function __init__() : Void untyped {
-		flash.ContextMenu = _global["ContextMenu"];
-	}
-}

+ 0 - 18
std/flash8/ContextMenuItem.hx

@@ -1,18 +0,0 @@
-package flash;
-
-extern class ContextMenuItem {
-	function new(caption:String, callb:Dynamic->ContextMenuItem->Void, ?separatorBefore:Bool, ?enabled:Bool, ?visible:Bool) : Void;
-	function copy() : ContextMenuItem;
-
-	dynamic function onSelect( v : Dynamic, c : ContextMenuItem ) : Void;
-
-	var enabled:Bool;
-	var visible:Bool;
-	var caption:String;
-	var separatorBefore:Bool;
-
-	private static function __init__() : Void untyped {
-		flash.ContextMenuItem = _global["ContextMenuItem"];
-	}
-}
-

+ 0 - 29
std/flash8/ExtendedKey.hx

@@ -1,29 +0,0 @@
-package flash;
-
-#if flash_lite
-
-/** flash lite only **/
-extern class ExtendedKey {
-
-	static var SOFT1 : String;
-	static var SOFT2 : String;
-	static var SOFT3 : String;
-	static var SOFT4 : String;
-	static var SOFT5 : String;
-	static var SOFT6 : String;
-	static var SOFT7 : String;
-	static var SOFT8 : String;
-	static var SOFT9 : String;
-	static var SOFT10 : String;
-	static var SOFT11 : String;
-	static var SOFT12 : String;
-
-	private static function __init__() : Void untyped {
-		flash.ExtendedKey = _global["ExtendedKey"];
-	}
-
-}
-
-#else
-	#error
-#end

+ 0 - 58
std/flash8/Key.hx

@@ -1,58 +0,0 @@
-package flash;
-
-#if flash_strict
-typedef KeyListener = {
-	function onKeyDown() : Void;
-	function onKeyUp() : Void;
-}
-#end
-
-extern class Key
-{
-	static inline var ALT : Int = 18;
-	static inline var ENTER : Int = 13;
-	static inline var SPACE : Int = 32;
-	static inline var UP : Int = 38;
-	static inline var DOWN : Int = 40;
-	static inline var LEFT : Int = 37;
-	static inline var RIGHT : Int = 39;
-	static inline var PGUP : Int = 33;
-	static inline var PGDN : Int = 34;
-	static inline var HOME : Int = 36;
-	static inline var END : Int = 35;
-	static inline var TAB : Int = 9;
-	static inline var CONTROL : Int = 17;
-	static inline var SHIFT : Int = 16;
-	static inline var ESCAPE : Int = 27;
-	static inline var INSERT : Int = 45;
-	static inline var DELETEKEY : Int = 46;
-	static inline var BACKSPACE : Int = 8;
-	static inline var CAPSLOCK : Int = 20;
-
-	// hide : static property _listeners(default,null) : Array<Dynamic>;
-
-	static function getAscii():Int;
-	static function getCode():Int;
-#if flash8
-	static function isAccessible():Bool;
-#end
-	static function isDown(code:Int):Bool;
-	static function isToggled(code:Int):Bool;
-
-	static dynamic function onKeyDown() : Void;
-	static dynamic function onKeyUp() : Void;
-
-#if flash_strict
-	static function addListener(listener:KeyListener):Void;
-	static function removeListener(listener:KeyListener):Bool;
-#else
-	static function addListener(listener:Dynamic):Void;
-	static function removeListener(listener:Dynamic):Bool;
-#end
-
-	private static function __init__() : Void untyped {
-		flash.Key = _global["Key"];
-		flash.Key.addListener(flash.Key);
-	}
-
-}

+ 0 - 74
std/flash8/Lib.hx

@@ -1,74 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package flash;
-
-class Lib {
-
-	public static var _global : Dynamic;
-	public static var _root : MovieClip;
-	public static var current : MovieClip;
-	static var onerror : String -> Array<String> -> Void;
-
-	public static function trace( str : String ) {
-		untyped __trace__(str);
-	}
-
-	public static function eval( str : String ) : Dynamic {
-		return untyped __eval__(str);
-	}
-
-	public static function getURL( url : String, ?target : String ) {
-		untyped __geturl__(url,if( target == null ) "_self" else target);
-	}
-
-	public static function fscommand( cmd : String, ?param : Dynamic ) {
-		untyped __geturl__("FSCommand:"+cmd,if( param == null ) "" else param);
-	}
-
-	public static function print( cmd : String, ?kind : String ) {
-		kind = if (kind == "bframe" || kind == "bmax") "print:#"+kind else "print:";
-		untyped __geturl__(kind,cmd);
-	}
-
-	public inline static function getTimer() : Int {
-		return untyped __gettimer__();
-	}
-
-	public static function getVersion() : String {
-		return untyped _root["$version"];
-	}
-
-	public static function registerClass( name : String, cl : {} ) {
-		untyped _global["Object"]["registerClass"](name,cl);
-	}
-
-	public static function keys( v : Dynamic ) : Array<String> {
-		return untyped __keys__(v);
-	}
-
-	public static function setErrorHandler(f) {
-		onerror = f;
-	}
-
-}
-
-

+ 0 - 34
std/flash8/LoadVars.hx

@@ -1,34 +0,0 @@
-package flash;
-
-extern class LoadVars implements Dynamic<String>
-{
-	var contentType:String;
-	var loaded:Bool;
-
-	function new() : Void;
-
-	function addRequestHeader(header:String, headerValue:String):Void;
-	// don't allow : function addRequestHeader( headers : Array<String> ) : Void;
-
-	function load(url:String):Bool;
-	function send(url:String,target:String,?method:String):Bool;
-	function sendAndLoad(url:String,targetObject:Dynamic,?method:String):Bool;
-	function getBytesLoaded():Int;
-	function getBytesTotal():Int;
-	function decode(queryString:String):Void;
-	function toString():String;
-
-	dynamic function onLoad(success:Bool):Void;
-	dynamic function onData(src:String):Void;
-
-	#if flash8
-	dynamic function onHTTPStatus( status : Int ) : Void;
-	#end
-
-	// undocumented var _customHeaders:Array<String>;
-
-	private static function __init__() : Void untyped {
-		flash.LoadVars = _global["LoadVars"];
-	}
-
-}

+ 0 - 20
std/flash8/LocalConnection.hx

@@ -1,20 +0,0 @@
-package flash;
-
-extern class LocalConnection #if !flash_strict implements Dynamic #end {
-
-	function new() : Void;
-
-	function connect(connectionName:String):Bool;
-	function send(connectionName:String, methodName:String, ?p1 : Dynamic, ?p2 : Dynamic, ?p3 : Dynamic, ?p4 : Dynamic, ?p5 : Dynamic, ?p6 : Dynamic ):Bool;
-
-	function close():Void;
-	function domain():String;
-	dynamic function allowDomain(domain:String):Bool;
-	dynamic function allowInsecureDomain(domain:String):Bool;
-	dynamic function onStatus(infoObject:Dynamic):Void;
-
-	private static function __init__() : Void untyped {
-		flash.LocalConnection = _global["LocalConnection"];
-	}
-
-}

+ 0 - 31
std/flash8/Microphone.hx

@@ -1,31 +0,0 @@
-package flash;
-
-extern class Microphone
-{
-
-	static var names(default,null) : Array<String>;
-	static function get(?index:Int) : Microphone;
-
-	var activityLevel(default,null) : Float;
-	var gain(default,null) : Float;
-	var index(default,null) : Int;
-	var muted(default,null) : Bool;
-	var name(default,null) : String;
-	var silenceLevel(default,null) : Int;
-	var silenceTimeOut(default,null) : Float;
-	var rate(default,null) : Float;
-	var useEchoSuppression(default,null) : Bool;
-
-	function setSilenceLevel(silenceLevel:Int,?timeOut:Float):Void;
-	function setRate(rate:Float):Void;
-	function setGain(gain:Float):Void;
-	function setUseEchoSuppression(useEchoSuppression:Bool):Void;
-
-	dynamic function onActivity(active:Bool):Void;
-	dynamic function onStatus(infoObject:Dynamic):Void;
-
-	private static function __init__() : Void untyped {
-		flash.Microphone = _global["Microphone"];
-	}
-
-}

+ 0 - 33
std/flash8/Mouse.hx

@@ -1,33 +0,0 @@
-package flash;
-
-#if flash_strict
-typedef MouseListener = {
-	function onMouseDown() : Void;
-	function onMouseMove() : Void;
-	function onMouseUp() : Void;
-	function onMouseWheel( delta : Float, scrollTarget : String ) : Void;
-}
-#end
-
-extern class Mouse
-{
-	static function show():Int;
-	static function hide():Int;
-	static dynamic function onMouseDown() : Void;
-	static dynamic function onMouseMove() : Void;
-	static dynamic function onMouseUp() : Void;
-
-#if flash_strict
-	static function addListener(listener:MouseListener):Void;
-	static function removeListener(listener:MouseListener):Bool;
-#else
-	static function addListener(listener:Dynamic):Void;
-	static function removeListener(listener:Dynamic):Bool;
-#end
-
-	private static function __init__() : Void untyped {
-		flash.Mouse = _global["Mouse"];
-		flash.Mouse.addListener(cast flash.Mouse);
-	}
-
-}

+ 0 - 181
std/flash8/MovieClip.hx

@@ -1,181 +0,0 @@
-package flash;
-
-private extern class MCBounds {
-	var xMin : Float;
-	var xMax : Float;
-	var yMin : Float;
-	var yMax : Float;
-}
-
-extern class MovieClip
-#if !flash_strict
-implements Dynamic
-#end
-{
-	var useHandCursor : Bool;
-	var enabled : Bool;
-	var focusEnabled : Bool;
-	//var menu : ContextMenu; rare, and we don't want to add __init__ for ContextMenu all the time
-	var tabChildren : Bool;
-	var tabEnabled : Bool;
-	var tabIndex : Int;
-	var hitArea : MovieClip;
-	var trackAsMenu : Bool;
-
-	var _x : Float;
-	var _y : Float;
-	var _xmouse : Float;
-	var _ymouse : Float;
-	var _xscale : Float;
-	var _yscale : Float;
-	var _width : Float;
-	var _height : Float;
-	var _alpha : Float;
-	var _lockroot : Bool;
-	var _visible : Bool;
-	var _target : String;
-	var _rotation : Float;
-	var _name : String;
-	var _droptarget(default,null) : String;
-	var _currentframe(default,null) : Int;
-	var _totalframes(default,null) : Int;
-	var _framesloaded(default,null) : Int;
-	var _quality : String;
-	var _focusrect : Bool;
-	var _soundbuftime : Float;
-	var _url : String;
-	var _parent : MovieClip;
-
-	function getURL( url : String, ?window : String, ?method : String ) : Void;
-	function unloadMovie() : Void;
-	function loadVariables( url : String, ?method : String ) : Void;
-	function loadMovie( url : String, ?method : String ) : Void;
-	function attachMovie(id : String, name : String, depth : Int, ?initObject : Dynamic) : MovieClip;
-
-	#if flash_strict
-	function swapDepths( depth : Int ) : Void;
-	#else
-	function swapDepths(mc : Dynamic) : Void;
-	#end
-	// function swapDepths( mc : String ) : Void;
-	// function swapDepths( mc : MovieClip ) : Void;
-	// function swapDepths( depth : Int ) : Void;
-
-	function localToGlobal(pt : { x : Float, y : Float } ) : Void;
-	function globalToLocal(pt : { x : Float, y : Float } ) : Void;
-
-	// optional param problem if called with a second Bool parameter
-	function hitTest( x_or_mc : Dynamic, ?y : Float, ?shape : Bool ) : Bool;
-
-	// function hitTest( x : Float, y : Float, shape : Bool ) : Bool;
-	// function hitTest( mc : MovieClip ) : Bool;
-	function getBounds(bounds  :  MovieClip) : MCBounds;
-	// don't allow function getBounds( bounds : String )
-	function getBytesLoaded() : Int;
-	function getBytesTotal() : Int;
-	function attachAudio(id : Dynamic) : Void;
-	function attachVideo(id : Dynamic) : Void;
-	function getDepth() : Int;
-
-	function setMask(mc : MovieClip) : Void;
-	// don't allow setMask( mc : String ) : Void
-	function play() : Void;
-	function stop() : Void;
-	function nextFrame() : Void;
-	function prevFrame() : Void;
-	function gotoAndPlay(frame : Dynamic) : Void;
-	// frame : String | Int
-	function gotoAndStop(frame : Dynamic) : Void;
-	// frame : String | Int
-	function duplicateMovieClip(name : String, depth : Int, ?initObject : Dynamic) : MovieClip;
-	function removeMovieClip() : Void;
-	function startDrag( lockCenter : Bool, ?left : Float, ?top : Float, ?right : Float, ?bottom : Float ) : Void;
-	function stopDrag() : Void;
-	function createEmptyMovieClip(name : String, depth : Int) : MovieClip;
-	function beginFill(rgb : Int, ?alpha : Float) : Void;
-
-#if !flash6
-	function getInstanceAtDepth(depth : Int) : MovieClip;
-	function getNextHighestDepth() : Int;
-#end
-
-#if flash8
-	function beginGradientFill(fillType : String, colors : Array<Int>, alphas : Array<Dynamic>, ratios : Array<Dynamic>, matrix : Dynamic, ?spreadMethod : String, ?interpolationMethod : String, ?focalPointRatio : Float ) : Void;
-#else
-	function beginGradientFill(fillType : String, colors : Array<Int>, alphas : Array<Dynamic>, ratios : Array<Dynamic>, matrix : Dynamic) : Void;
-#end
-	// matrix : flash.geom.Matrix | Anonymous object a...i | Anonymous object (matrixType x,y,w,h,r)
-
-	function moveTo(x : Float, y : Float) : Void;
-	function lineTo(x : Float, y : Float) : Void;
-	function curveTo(controlX : Float, controlY : Float, anchorX : Float, anchorY : Float) : Void;
-#if flash8
-	function lineStyle( ?thickness : Float, ?rgb : Int, ?alpha : Float, ?pixelHinting : Bool, ?noScale : String, ?capsStyle : String, ?jointStyle : String, ?miterLimit : Float) : Void;
-#else
-	function lineStyle( ?thickness : Float, ?rgb : Int, ?alpha : Float) : Void;
-#end
-	function endFill() : Void;
-	function clear() : Void;
-
-#if flash8
-	function createTextField(instanceName : String, depth : Int, x : Float, y : Float, width : Float, height : Float) : TextField;
-#else
-	function createTextField(instanceName : String, depth : Int, x : Float, y : Float, width : Float, height : Float) : Void;
-#end
-	function getTextSnapshot() : TextSnapshot;
-	function getSWFVersion() : Int;
-
-	dynamic function onData() : Void;
-	dynamic function onDragOut() : Void;
-	dynamic function onDragOver() : Void;
-	dynamic function onEnterFrame() : Void;
-	dynamic function onKeyDown() : Void;
-	dynamic function onKeyUp() : Void;
-	dynamic function onKillFocus(newFocus : Dynamic) : Void;
-	dynamic function onLoad() : Void;
-	dynamic function onMouseDown() : Void;
-	dynamic function onMouseMove() : Void;
-	dynamic function onMouseUp() : Void;
-	dynamic function onPress() : Void;
-	dynamic function onRelease() : Void;
-	dynamic function onReleaseOutside() : Void;
-	dynamic function onRollOut() : Void;
-	dynamic function onRollOver() : Void;
-	dynamic function onSetFocus(oldFocus : Dynamic) : Void;
-	dynamic function onUnload() : Void;
-
-#if flash8
-	var filters : Array<flash.filters.BitmapFilter>;
-	var blendMode : Dynamic;
-	var cacheAsBitmap : Bool;
-	var opaqueBackground : Int;
-	var scrollRect : Dynamic;
-	var transform : flash.geom.Transform;
-	var scale9Grid : flash.geom.Rectangle<Float>;
-
-	function getRect( bounds : MovieClip ) : MCBounds;
-	// don't allow bounds : String
-
-
-	function attachBitmap( bmp : flash.display.BitmapData, depth : Int, ?pixelSnapping : String, ?smoothing : Bool ) : Void;
-	function beginBitmapFill( bmp : flash.display.BitmapData , ?matrix:flash.geom.Matrix, ?repeat:Bool, ?smoothing:Bool ) : Void;
-  	function lineGradientStyle( fillType:String, colors:Array<Int>, alphas:Array<Dynamic>, ratios:Array<Dynamic>, matrix:Dynamic, ?spreadMethod : String, ?interpolationMethod:String, ?focalPointRatio:Float ) : Void;
-
-#end
-
-
-	/** FP9 only **/
-	var forceSmoothing : Bool;
-
-
-// MT extension
-#if flash_strict
-	var smc : flash.MovieClip;
-#end
-	private static function __init__() : Void untyped {
-		flash.MovieClip = _global["MovieClip"];
-	}
-
-}
-
-

+ 0 - 46
std/flash8/MovieClipLoader.hx

@@ -1,46 +0,0 @@
-package flash;
-
-#if flash_strict
-typedef MclListener = {
-
-	function onLoadInit(target:MovieClip) : Void;
-	function onLoadStart(target:MovieClip) : Void;
-	function onLoadProgress(target:MovieClip, loaded : Int, total : Int) : Void;
-	function onLoadComplete(target:MovieClip, httpStatus : Int) : Void;
-	function onLoadError(target:MovieClip, error:String, httpStatus : Int) : Void;
-
-}
-#end
-
-extern class MovieClipLoader
-{
-	// don't allow target : String
-	// and target : Int (_levelX ?)
-
-	function new() : Void;
-	function getProgress(target:MovieClip): { bytesLoaded : Int, bytesTotal : Int };
-	function loadClip(url:String, target:MovieClip):Bool;
-	function unloadClip(target:MovieClip):Bool;
-
-	dynamic function onLoadInit(target:MovieClip) : Void;
-	dynamic function onLoadStart(target:MovieClip) : Void;
-	dynamic function onLoadProgress(target:MovieClip, loaded : Int, total : Int) : Void;
-	dynamic function onLoadComplete(target:MovieClip) : Void;
-	dynamic function onLoadError(target:MovieClip, error:String) : Void;
-
-#if flash_strict
-	function addListener(listener:MclListener):Bool;
-	function removeListener(listener:MclListener):Bool;
-#else
-	function addListener(listener:Dynamic):Bool;
-	function removeListener(listener:Dynamic):Bool;
-#end
-
-	/** in FP 9 **/
-	var checkPolicyFile : Bool;
-
-	private static function __init__() : Void untyped {
-		flash.MovieClipLoader = _global["MovieClipLoader"];
-	}
-
-}

+ 0 - 21
std/flash8/NetConnection.hx

@@ -1,21 +0,0 @@
-package flash;
-
-extern class NetConnection #if !flash_strict implements Dynamic #end {
-
-	var isConnected(default,null) : Bool;
-	var uri(default,null) : String;
-
-	function new() : Void;
-	function connect( targetURI : String, ?p1 : Dynamic, ?p2 : Dynamic, ?p3 : Dynamic, ?p4 : Dynamic ) : Bool;
-	function call( remoteMethod : String, resultObject : Dynamic, ?p1 : Dynamic, ?p2 : Dynamic, ?p3 : Dynamic, ?p4 : Dynamic, ?p5 : Dynamic, ?p6 : Dynamic ) : Void;
-	function addHeader( header : String, mustUnderstand : Bool, object : Dynamic ) : Void;
-	function close() : Void;
-
-	// events
-	dynamic function onStatus(infoObject : Dynamic) : Void;
-	dynamic function onResult(infoObject : Dynamic) : Void;
-
-	private static function __init__() : Void untyped {
-		flash.NetConnection = _global["NetConnection"];
-	}
-}

+ 0 - 39
std/flash8/NetStream.hx

@@ -1,39 +0,0 @@
-package flash;
-
-extern class NetStream
-{
-	var bufferLength(default,null) : Float;
-	var bufferTime(default,null) : Float;
-	var bytesLoaded(default,null) : Int;
-	var bytesTotal(default,null) : Int;
-	var time(default,null) : Float;
-	var currentFps(default,null) : Float;
-	var liveDelay(default,null) : Float;
-
-	/** FP9 only **/
-	var checkPolicyFile : Bool;
-
-	function new( connection : NetConnection ) : Void;
-	dynamic function onMetaData( info : Dynamic ) : Void;
-	dynamic function onStatus( info : Dynamic ) : Void;
-	function publish( name : Dynamic, ?type : String ) : Void;
-	function play( name : String, ?start : Float, ?len : Float, ?reset : Dynamic ) : Void;
-	function receiveAudio( flag : Bool ) : Void;
-	function receiveVideo( flag : Dynamic ) : Void;
-	function pause( ?flag : Bool ) : Void;
-	function seek( offset : Float ) : Void;
-	function close() : Void;
-	function attachAudio( theMicrophone : Microphone ) : Void;
-	function attachVideo( theCamera : Camera, ?snapshotMilliseconds : Float ) : Void;
-	function send( handlerName : String, ?p1 : Dynamic, ?p2 : Dynamic, ?p3 : Dynamic, ?p4 : Dynamic, ?p5 : Dynamic ) : Void;
-	function setBufferTime( bufferTime : Float ) : Void;
-
-#if flash8
-	dynamic function onCuePoint( info : Dynamic ) : Void;
-#end
-
-	private static function __init__() : Void untyped {
-		flash.NetStream = _global["NetStream"];
-	}
-
-}

+ 0 - 20
std/flash8/PrintJob.hx

@@ -1,20 +0,0 @@
-package flash;
-
-extern class PrintJob
-{
-	function new() : Void;
-	function start():Bool;
-	function addPage(target:Dynamic, ?printArea:Dynamic, ?options:Dynamic, ?frameNum:Float):Bool;
-	function send():Void;
-
-	var paperWidth(default,null) : Float;
-	var paperHeight(default,null) : Float;
-	var pageWidth(default,null) : Float;
-	var pageHeight(default,null) : Float;
-	var orientation(default,null) : String;
-
-	private static function __init__() : Void untyped {
-		flash.PrintJob = _global["PrintJob"];
-	}
-
-}

+ 0 - 22
std/flash8/Selection.hx

@@ -1,22 +0,0 @@
-package flash;
-
-typedef SelectionListener = {
-	var onSetFocus: TextField -> TextField -> Void;
-}
-
-extern class Selection
-{
-	static function getBeginIndex():Int;
-	static function getEndIndex():Int;
-	static function getCaretIndex():Int;
-	static function getFocus():String;
-	static function setFocus(newFocus:Dynamic):Bool;
-	static function setSelection(beginIndex:Int, endIndex:Int):Void;
-	static function addListener(listener:SelectionListener):Void;
-	static function removeListener(listener:SelectionListener):Bool;
-
-	private static function __init__() : Void untyped {
- 		flash.Selection = _global["Selection"];
-	}
-
-}

+ 0 - 45
std/flash8/SharedObject.hx

@@ -1,45 +0,0 @@
-package flash;
-
-extern class SharedObject
-{
-	#if flash8
-	static function getLocal(name:String,?localPath:String,?secure:Bool):SharedObject;
-	#else
-	static function getLocal(name:String,?localPath:String):SharedObject;
-	#end
-
-	static function getRemote(name:String,remotePath:String,?persistence:Dynamic):SharedObject;
-	static function deleteAll(url:String) : Void;
-	static function getDiskUsage(url:String) : Int;
-
-	function send( handler : String, ?p1 : Dynamic, ?p2 : Dynamic, ?p3 : Dynamic, ?p4 : Dynamic, ?p5 : Dynamic ) : Void;
-	function flush(?minDiskSpace:Float):Dynamic;
-	function connect( cnx : NetConnection ) : Bool;
-	function close():Void;
-	function getSize():Float;
-	function setFps(updatesPerSecond:Float):Bool;
-
-	dynamic function onStatus(infoObject:Dynamic):Void;
-	dynamic function onSync(objArray:Array<Dynamic>):Void;
-
-	function clear() : Void;
-
-
-	#if flash_lite
-	/** flash lite only **/
-	static function getMaxSize():Float;
-
-	/** flash lite only **/
-	static function addListener():Void;
-
-	/** flash lite only **/
-	static function removeListener(soName:String):Void;
-	#end
-
-	var data:Dynamic;
-
-	private static function __init__() : Void untyped {
-		flash.SharedObject = _global["SharedObject"];
-	}
-
-}

+ 0 - 35
std/flash8/Sound.hx

@@ -1,35 +0,0 @@
-package flash;
-
-extern class Sound
-{
-	var duration(default,null):Float;
-	var id3(default,null):Dynamic;
-	var position(default,null):Float;
-
-	/** FP9 only **/
-	var checkPolicyFile : Bool;
-
-	function new( ?target:Dynamic ) : Void;
-
-	dynamic function onLoad(success:Bool):Void;
-	dynamic function onSoundComplete():Void;
-	dynamic function onID3():Void;
-
-	function getPan():Float;
-	function getTransform():Dynamic;
-	function getVolume():Float;
-	function setPan(value:Float):Void;
-	function setTransform(transformObject:Dynamic):Void;
-	function setVolume(value:Float):Void;
-	function stop(?linkageID:String):Void;
-	function attachSound(id:String):Void;
-	function start(?secondOffset:Float, ?loops:Float):Void;
-	function loadSound(url:String, isStreaming:Bool):Void;
-	function getBytesLoaded():Float;
-	function getBytesTotal():Float;
-
-	private static function __init__() : Void untyped {
-		flash.Sound = _global["Sound"];
-	}
-
-}

+ 0 - 28
std/flash8/Stage.hx

@@ -1,28 +0,0 @@
-package flash;
-
-extern class Stage
-{
-	static var width:Float;
-	static var height:Float;
-	static var scaleMode:String;
-	static var align:String;
-	static var showMenu:Bool;
-	static function addListener(listener:Dynamic):Void;
-	static function removeListener(listener:Dynamic):Void;
-
-	#if flash8
-	/**
-		Set to "fullScreen" in order to set Flash to fullscreen
-		(can only be done in Mouse/Keyboard event listener).
-		Don't forget allowfullscreen="true" in your SWF parameters.
-	**/
-	static var displayState : String;
-	static var fullScreenSourceRect : flash.geom.Rectangle<Int>;
-	static dynamic function onFullScreen( full : Bool ) : Void;
-	#end
-
-	private static function __init__() : Void untyped {
-		flash.Stage = _global["Stage"];
-	}
-
-}

+ 0 - 15
std/flash8/System.hx

@@ -1,15 +0,0 @@
-package flash;
-
-extern class System
-{
-	static var useCodepage:Bool;
-	static var exactSettings:Bool;
-	static function showSettings(?tabID:Float):Void;
-	static function setClipboard(text:String):Void;
-	static dynamic function onStatus(infoObject:Dynamic):Void;
-
-	private static function __init__() : Void untyped {
-		flash.System = _global["System"];
-	}
-
-}

+ 0 - 93
std/flash8/TextField.hx

@@ -1,93 +0,0 @@
-package flash;
-
-extern class TextField
-{
-	var _x:Float;
-	var _y:Float;
-	var _xmouse:Float;
-	var _ymouse:Float;
-	var _xscale:Float;
-	var _yscale:Float;
-	var _width:Float;
-	var _height:Float;
-	var _alpha:Float;
-	var _visible:Bool;
-	var _target:String;
-	var _rotation:Float;
-	var _name:String;
-	var _framesloaded:Int;
-	var _droptarget:String;
-	var _currentframe:Int;
-	var _totalframes:Int;
-	var _quality:String;
-	var _focusrect:Bool;
-	var _soundbuftime:Float;
-	var _url:String;
-	var _parent:MovieClip;
-
-	var autoSize:Dynamic;
-	var background:Bool;
-	var backgroundColor:Int;
-	var border:Bool;
-	var borderColor:Int;
-	var bottomScroll:Float;
-	var condenseWhite:Bool;
-	var embedFonts:Bool;
-	var hscroll:Float;
-	var html:Bool;
-	var htmlText:String;
-	var length:Int;
-	var maxChars:Int;
-	var maxhscroll:Float;
-	var maxscroll:Float;
-	var multiline:Bool;
-	var password:Bool;
-	var restrict:String;
-	var scroll:Float;
-	var selectable:Bool;
-	var tabEnabled:Bool;
-	var tabIndex:Int;
-	var text:String;
-	var textColor:Int;
-	var textHeight:Float;
-	var textWidth:Float;
-	var type:String;
-	var variable:String;
-	var wordWrap:Bool;
-	var mouseWheelEnabled:Bool;
-
-#if flash8
-	var antiAliasType:String;
-	var gridFitType:String;
-	var sharpness:Float;
-	var filters : Array<Dynamic>;
-	var thickness:Float;
-#end
-
-	var styleSheet:flash.text.StyleSheet;
-
-	function replaceText(beginIndex:Int,endIndex:Int,newText:String):Void;
-	function replaceSel(newText:String):Void;
-	function getTextFormat(?beginIndex:Int,?endIndex:Int):TextFormat;
-
-	// wtf ?? optional first argument !
-	// if beginIndex and endIndex are null, does it works ?
-	function setTextFormat( begin : Dynamic, ?end : Dynamic, ?tf : TextFormat ):Void;
-	function removeTextField():Void;
-	function getNewTextFormat():TextFormat;
-	function setNewTextFormat(tf:TextFormat):Void;
-	function getDepth():Int;
-	function addListener(listener:Dynamic):Bool;
-	function removeListener(listener:Dynamic):Bool;
-	static function getFontList():Array<Dynamic>;
-
-	dynamic function onChanged(changedField:TextField):Void;
-	dynamic function onKillFocus(newFocus:Dynamic):Void;
-	dynamic function onScroller(scrolledField:TextField):Void;
-	dynamic function onSetFocus(oldFocus:Dynamic):Void;
-
-	private static function __init__() : Void untyped {
-		flash.TextField = _global["TextField"];
-	}
-
-}

+ 0 - 40
std/flash8/TextFormat.hx

@@ -1,40 +0,0 @@
-package flash;
-
-extern class TextFormat
-{
-	var font:String;
-	var size:Float;
-	var color:Int;
-	var url:String;
-	var target:String;
-	var bold:Bool;
-	var italic:Bool;
-	var underline:Bool;
-	var align:String;
-	var leftMargin:Float;
-	var rightMargin:Float;
-	var indent:Float;
-	var leading:Float;
-	var blockIndent:Float;
-	var tabStops:Array<Int>;
-	var bullet:Bool;
-
-	function new( ?font:String, ?size:Float, ?textColor:Int,
-                  ?bold:Bool, ?italic:Bool, ?underline:Bool,
-                  ?url:String, ?window:String, ?align:String,
-                  ?leftMargin:Float, ?rightMargin:Float, ?indent:Float,
-                  ?leading:Float ) : Void;
-
-	function getTextExtent(text:String, ?width : Float) : Dynamic;
-
-	#if flash8
-	var kerning : Bool;
-	var letterSpacing : Float;
-	var display : String;
-	#end
-
-	private static function __init__() : Void untyped {
-		flash.TextFormat = _global["TextFormat"];
-	}
-
-}

+ 0 - 18
std/flash8/TextSnapshot.hx

@@ -1,18 +0,0 @@
-package flash;
-
-extern class TextSnapshot
-{
-	function findText(startIndex:Int, textToFind:String, caseSensitive:Bool):Float;
-	function getCount():Int;
-	function getSelected(start:Int, ?end:Int):Bool;
-	function getSelectedText(?includeLineEndings:Bool):String;
-	function getText(start:Int, end:Int, ?includeLineEndings:Bool):String;
-	function hitTestTextNearPos(x:Float, y:Float, ?closeDist:Float):Float;
-	function setSelectColor(color:Int):Void;
-	function setSelected(start:Int, end:Int, select:Bool):Void;
-
-	private static function __init__() : Void untyped {
-		flash.TextSnapshot = _global["TextSnapshot"];
-	}
-
-}

+ 0 - 30
std/flash8/Video.hx

@@ -1,30 +0,0 @@
-package flash;
-
-extern class Video
-{
-	var deblocking : Float;
-	var height : Float;
-	var smoothing : Bool;
-	var width : Float;
-
-	function attachVideo( source : Dynamic ) : Void;
-	function clear() : Void;
-
-	#if flash_lite
-	/** flash lite only **/
-	function play():Bool;
-	/** flash lite only **/
-	function close():Void;
-	/** flash lite only **/
-	function stop():Void;
-	/** flash lite only **/
-	function pause():Void;
-	/** flash lite only **/
-	function resume():Void;
-	#end
-
-	private static function __init__() : Void untyped {
- 		flash.Video = _global["Video"];
-	}
-
-}

+ 0 - 19
std/flash8/XMLRequest.hx

@@ -1,19 +0,0 @@
-package flash;
-
-class XMLRequest {
-
-	public static function send( url : String, xml : Xml, ?target : String, ?post : Bool, ?content : String ) {
-		var x : Dynamic = untyped xml.__x;
-		x.contentType = if( content == null ) "text/xml" else content;
-		x.send(url,if( target == null ) "_self" else target,if( post ) "POST" else "GET");
-	}
-
-	public static function load( url : String, xml : Xml, onData : Null<String> -> Void, ?post : Bool, ?content : String ) {
-		var x : Dynamic = untyped xml.__x;
-		var recv = untyped __new__(_global["XML"]);
-		recv.onData = onData;
-		x.contentType = if( content == null ) "text/xml" else content;
-		x.sendAndLoad(url,recv);
-	}
-
-}

+ 0 - 18
std/flash8/XMLSocket.hx

@@ -1,18 +0,0 @@
-package flash;
-
-extern class XMLSocket {
-
-	function new() : Void;
-	function connect( url : String, port : Int ) : Void;
-	function send( data : Dynamic ) : Bool;
-	function close() : Bool;
-	dynamic function onData( src : String ) : Void;
-	//dynamic function onXML( src : Xml ) : Void;
-	dynamic function onConnect( success : Bool ) : Void;
-	dynamic function onClose() : Void;
-
-	private static function __init__() : Void untyped {
-		flash.XMLSocket = _global["XMLSocket"];
-	}
-
-}

+ 0 - 118
std/flash8/_std/Reflect.hx

@@ -1,118 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-@:coreApi class Reflect {
-
-	public inline static function hasField( o : Dynamic, field : String ) : Bool untyped {
-		return __this__["hasOwnProperty"]["call"](o,field);
-	}
-
-	public inline static function field( o : Dynamic, field : String ) : Dynamic untyped {
-		return o[field];
-	}
-
-	public inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {
-		o[field] = value;
-	}
-
-	static function findAccessor( c : Class<Dynamic>, name : String ):Dynamic untyped {
-		do {
-			var getter = c.__properties__[name];
-			if (getter != null)
-				return getter;
-			c = c.__super__;
-		} while (c != null);
-		return null;
-	}
-
-	public static function getProperty( o : Dynamic, field : String ) : Dynamic untyped {
-		var getter = findAccessor( Std.is(o,Class) ? o : o.__class__, "get_" +field);
-		return if (getter != null)
-			o[getter]["apply"](o, [field]);
-		else
-			Reflect.field(o, field);
-	}
-
-	public static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {
-		var setter = findAccessor( Std.is(o,Class) ? o : o.__class__, "set_" +field);
-		return if (setter != null)
-			o[setter]["apply"](o, [value]);
-		else
-			Reflect.setField(o, field, value);
-	}
-
-	public inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array<Dynamic> ) : Dynamic untyped {
-		return func["apply"](o,args);
-	}
-
-	public static function fields( o : Dynamic ) : Array<String> untyped {
-		if( o == null ) return new Array();
-		var a : Array<String> = __keys__(o);
-		var i = 0;
-		while( i < a.length ) {
-			if( a[i] == "__id__" || !a["hasOwnProperty"]["call"](o,a[i]) )
-				a.splice(i,1);
-			else
-				++i;
-		}
-		return a;
-	}
-
-	public static function isFunction( f : Dynamic ) : Bool untyped {
-		return __typeof__(f) == "function" && f.__name__ == null;
-	}
-
-	public static function compare<T>( a : T, b : T ) : Int {
-		return ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);
-	}
-
-	public static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {
-		return untyped f1 == f2 || (f1["f"] == f2["f"] && f1["o"] == f2["o"] && f1["f"] != null);
-	}
-
-	public static function isObject( v : Dynamic ) : Bool untyped {
-		var t = __typeof__(v);
-		return (t == "string" || (t == "object" && v.__enum__ == null) || (t == "function" && v.__name__ != null));
-	}
-
-	public static function isEnumValue( v : Dynamic ) : Bool {
-		return v.__enum__ != null;
-	}
-
-	public static function deleteField( o : Dynamic, field : String ) : Bool untyped {
-		if( __this__["hasOwnProperty"]["call"](o,field) != true ) return false;
-		__delete__(o,field);
-		return true;
-	}
-
-	public static function copy<T>( o : T ) : T {
-		var o2 : Dynamic = {};
-		for( f in Reflect.fields(o) )
-			Reflect.setField(o2,f,Reflect.field(o,f));
-		return o2;
-	}
-
-	@:overload(function( f : Array<Dynamic> -> Void ) : Dynamic {})
-	public static function makeVarArgs( f : Array<Dynamic> -> Dynamic ) : Dynamic {
-		return function() { return f(untyped __arguments__); };
-	}
-
-}

+ 0 - 77
std/flash8/_std/Std.hx

@@ -1,77 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-@:coreApi class Std {
-
-	@:ifFeature("typed_cast")
-	public static function is( v : Dynamic, t : Dynamic ) : Bool {
-		return untyped flash.Boot.__instanceof(v,t);
-	}
-
-	public static function instance<T:{},S:T>( value : T, c : Class<S> ) : S {
-		return Std.is(value, c) ? cast value : null;
-	}
-
-	public static function string( s : Dynamic ) : String {
-		return untyped flash.Boot.__string_rec(s,"");
-	}
-
-	public static inline function int( x : Float ) : Int {
-		return (cast x) | 0;
-	}
-
-	public static function parseInt( x : String ) : Null<Int> untyped {
-		var v;
-		if( x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code)
-			v = _global["parseInt"](x);
-		else
-			v = _global["parseInt"](x, 10);
-		if( _global["isNaN"](v) )
-			return null;
-		return v;
-	}
-
-	public static function parseFloat( x : String ) : Float {
-		return untyped _global["parseFloat"](x);
-	}
-
-	public static function random( x : Int ) : Int {
-		return untyped __random__(x);
-	}
-
-	static function __init__() : Void untyped {
-		var g : Dynamic = _global;
-		g["Int"] = { __name__ : ["Int"] };
-		g["Bool"] = { __ename__ : ["Bool"] };
-		g.Dynamic = { __name__ : [__unprotect__("Dynamic")] };
-		g.Class = { __name__ : [__unprotect__("Class")] };
-		g.Enum = {};
-		g.Void = { __ename__ : [__unprotect__("Void")] };
-		g["Float"] = _global["Number"];
-		g["Float"][__unprotect__("__name__")] = ["Float"];
-		Array.prototype[__unprotect__("__class__")] = Array;
-		Array[__unprotect__("__name__")] = ["Array"];
-		String.prototype[__unprotect__("__class__")] = String;
-		String[__unprotect__("__name__")] = ["String"];
-		g["ASSetPropFlags"](Array.prototype,null,7);
-	}
-
-}

+ 0 - 208
std/flash8/_std/Type.hx

@@ -1,208 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-enum ValueType {
-	TNull;
-	TInt;
-	TFloat;
-	TBool;
-	TObject;
-	TFunction;
-	TClass( c : Class<Dynamic> );
-	TEnum( e : Enum<Dynamic> );
-	TUnknown;
-}
-
-@:coreApi class Type {
-
-	public static function getClass<T>( o : T ) : Class<T> untyped {
-		if( o.__enum__ != null )
-			return null;
-		return o.__class__;
-	}
-
-	public static function getEnum( o : EnumValue ) : Enum<Dynamic> untyped {
-		return o.__enum__;
-	}
-
-	public static function getSuperClass( c : Class<Dynamic> ) : Class<Dynamic> untyped {
-		return c.__super__;
-	}
-
-
-	public static function getClassName( c : Class<Dynamic> ) : String {
-		if( c == null )
-			return null;
-		var a : Array<String> = untyped c.__name__;
-		return a.join(".");
-	}
-
-	public static function getEnumName( e : Enum<Dynamic> ) : String {
-		var a : Array<String> = untyped e.__ename__;
-		return a.join(".");
-	}
-
-	public static function resolveClass( name : String ) : Class<Dynamic> untyped {
-		var cl : Class<Dynamic> = untyped __eval__(name);
-		// ensure that this is a class
-		if( cl == null || cl.__name__ == null )
-			return null;
-		return cl;
-	}
-
-
-	public static function resolveEnum( name : String ) : Enum<Dynamic> untyped {
-		var e : Enum<Dynamic> = untyped __eval__(name);
-		// ensure that this is an enum
-		if( e == null || e.__ename__ == null )
-			return null;
-		return e;
-	}
-
-	public static function createInstance<T>( cl : Class<T>, args : Array<Dynamic> ) : T untyped {
-		if( cl == Array ) return new Array();
-		var o = { __constructor__ : cl, __proto__ : cl.prototype };
-		cl["apply"](o,args);
-		return o;
-	}
-
-	public static function createEmptyInstance<T>( cl : Class<T> ) : T untyped {
-		if( cl == Array ) return new Array();
-		var o : Dynamic = __new__(_global["Object"]);
-		o.__proto__ = cl.prototype;
-		return o;
-	}
-
-	public static function createEnum<T>( e : Enum<T>, constr : String, ?params : Array<Dynamic> ) : T {
-		var f:Dynamic = Reflect.field(e,constr);
-		if( f == null ) throw "No such constructor "+constr;
-		if( Reflect.isFunction(f) ) {
-			if( params == null ) throw "Constructor "+constr+" need parameters";
-			return Reflect.callMethod(e,f,params);
-		}
-		if( params != null && params.length != 0 )
-			throw "Constructor "+constr+" does not need parameters";
-		return f;
-	}
-
-	public static function createEnumIndex<T>( e : Enum<T>, index : Int, ?params : Array<Dynamic> ) : T {
-		var c : String = (untyped e.__constructs__)[index];
-		if( c == null ) throw index+" is not a valid enum constructor index";
-		return createEnum(e,c,params);
-	}
-
-	public static function getInstanceFields( c : Class<Dynamic> ) : Array<String> {
-		var a = Reflect.fields(untyped c.prototype);
-		a.remove("__class__");
-		c = untyped c.__super__;
-		while( c != null ) {
-			for( f in Reflect.fields(untyped c.prototype) ) {
-				a.remove(f);
-				a.push(f);
-			}
-			c = untyped c.__super__;
-		}
-		a.remove("__class__");
-		return a;
-	}
-
-	public static function getClassFields( c : Class<Dynamic> ) : Array<String> {
-		var a = Reflect.fields(c);
-		a.remove(__unprotect__("__name__"));
-		a.remove(__unprotect__("__interfaces__"));
-		a.remove(__unprotect__("__super__"));
-		a.remove(__unprotect__("__properties__"));
-		return a;
-	}
-
-	public static function getEnumConstructs( e : Enum<Dynamic> ) : Array<String> {
-		var a : Array<String> = untyped e.__constructs__;
-		return a.copy();
-	}
-
-	public static function typeof( v : Dynamic ) : ValueType {
-		switch( untyped __typeof__(v) ) {
-		case "null": return TNull;
-		case "boolean": return TBool;
-		case "string": return TClass(String);
-		case "number":
-			// this should handle all cases : NaN, +/-Inf and Floats outside range
-			if( Math.ceil(v) == v%2147483648.0 )
-				return TInt;
-			return TFloat;
-		case "object":
-			var e = v.__enum__;
-			if( e != null )
-				return TEnum(e);
-			var c = v.__class__;
-			if( c != null )
-				return TClass(c);
-			return TObject;
-		case "function":
-			if( v.__name__ != null )
-				return TObject;
-			return TFunction;
-		case "undefined":
-			return TNull;
-		default:
-			return TUnknown;
-		}
-	}
-
-	public static function enumEq<T>( a : T, b : T ) : Bool untyped {
-		if( a == b )
-			return true;
-		if( a[0] != b[0] )
-			return false;
-		for( i in 2...a.length )
-			if( !enumEq(a[i],b[i]) )
-				return false;
-		var e = a.__enum__;
-		if( e != b.__enum__ || e == null )
-			return false;
-		return true;
-	}
-
-	public static function enumConstructor( e : EnumValue ) : String {
-		return untyped e[0];
-	}
-
-	public static function enumParameters( e : EnumValue ) : Array<Dynamic> {
-		return untyped e["slice"](2);
-	}
-
-	public inline static function enumIndex( e : EnumValue ) : Int {
-		return untyped e[1];
-	}
-
-	public static function allEnums<T>( e : Enum<T> ) : Array<T> {
-		var all = [];
-		var cst : Array<String> = untyped e.__constructs__;
-		for( c in cst ) {
-			var v = Reflect.field(e,c);
-			if( !Reflect.isFunction(v) )
-				all.push(v);
-		}
-		return all;
-	}
-
-}
-

+ 0 - 81
std/flash8/_std/haxe/ds/IntMap.hx

@@ -1,81 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package haxe.ds;
-
-@:coreApi class IntMap<T> implements haxe.Constraints.IMap<Int,T>{
-
-	private var h : Dynamic;
-
-	public function new() : Void {
-		h = untyped __new__(_global["Object"]);
-	}
-
-	public function set( key : Int, value : T ) : Void {
-		h[key] = value;
-	}
-
-	public function get( key : Int ) : Null<T> {
-		return h[key];
-	}
-
-	public function exists( key : Int ) : Bool {
-		return untyped h["hasOwnProperty"](key);
-	}
-
-	public function remove( key : Int ) : Bool {
-		if( untyped !h["hasOwnProperty"](key) ) return false;
-		untyped __delete__(h,key);
-		return true;
-	}
-
-	public function keys() : Iterator<Int> {
-		var l : Array<Int> = untyped __keys__(h);
-		for( x in 0...l.length )
-			l[x] = Std.int(l[x]);
-		return l.iterator();
-	}
-
-	public function iterator() : Iterator<T> {
-		return untyped {
-			ref : h,
-			it : keys(),
-			hasNext : function() { return __this__.it[__unprotect__("hasNext")](); },
-			next : function() { var i = __this__.it[__unprotect__("next")](); return __this__.ref[i]; }
-		};
-	}
-
-	public function toString() : String {
-		var s = new StringBuf();
-		s.add("{");
-		var it = keys();
-		for( i in it ) {
-			s.add(i);
-			s.add(" => ");
-			s.add(Std.string(get(i)));
-			if( it.hasNext() )
-				s.add(", ");
-		}
-		s.add("}");
-		return s.toString();
-	}
-
-}

+ 0 - 102
std/flash8/_std/haxe/ds/ObjectMap.hx

@@ -1,102 +0,0 @@
-/*
- * Copyright (C)2005-2013 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of h software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and h permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-package haxe.ds;
-
-@:coreApi
-class ObjectMap <K:{ }, V> implements haxe.Constraints.IMap<K,V> {
-
-	static var count = 0;
-
-	static inline function assignId(obj: { } ):Int {
-		return untyped obj.__id__ = ++count;
-	}
-
-	static inline function getId(obj: { } ):Int {
-		return untyped obj.__id__;
-	}
-
-	var h: { };
-
-	public function new():Void {
-		h = untyped __new__(_global["Object"]);
-		untyped h.__keys__ = untyped __new__(_global["Object"]);
-	}
-
-	public function set(key:K, value:V):Void untyped {
-		var id = "$" + (key.__id__ != null ? key.__id__ : assignId(key));
-		h[id] = value;
-		h.__keys__[id] = key;
-	}
-
-	public inline function get(key:K):Null<V> {
-		return untyped h["$" +getId(key)];
-	}
-
-	public inline function exists(key:K):Bool {
-		return untyped h["hasOwnProperty"]("$" +getId(key));
-	}
-
-	public function remove( key : K ) : Bool {
-		var key = "$" + getId(key);
-		if( untyped !h["hasOwnProperty"](key) ) return false;
-		untyped __delete__(h,key);
-		untyped __delete__(h.__keys__,key);
-		return true;
-	}
-
-	public function keys() : Iterator<K> {
-		var a = [];
-		untyped {
-			var keys:Iterator<String> = __hkeys__(h.__keys__)["iterator"]();
-			for (key in keys) {
-				if( h.hasOwnProperty("$" +key) )
-					a.push(h.__keys__["$" +key]);
-			}
-		}
-		return a.iterator();
-	}
-
-	public function iterator() : Iterator<V> {
-		return untyped {
-			ref : h,
-			it : __hkeys__(h.__keys__)["iterator"](),
-			hasNext : function() { return __this__.it[__unprotect__("hasNext")](); },
-			next : function() { var i = __this__.it[__unprotect__("next")](); return __this__.ref["$" +i]; }
-		};
-	}
-
-	public function toString() : String {
-		var s = new StringBuf();
-		s.add("{");
-		var it = keys();
-		for( i in it ) {
-			s.add(Std.string(i));
-			s.add(" => ");
-			s.add(Std.string(get(i)));
-			if( it.hasNext() )
-				s.add(", ");
-		}
-		s.add("}");
-		return s.toString();
-	}
-}

+ 0 - 79
std/flash8/_std/haxe/ds/StringMap.hx

@@ -1,79 +0,0 @@
-/*
- * Copyright (C)2005-2012 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package haxe.ds;
-
-@:coreApi class StringMap<T> implements haxe.Constraints.IMap<String,T> {
-
-	private var h : Dynamic;
-
-	public function new() : Void {
-		h = untyped __new__(_global["Object"]);
-	}
-
-	public function set( key : String, value : T ) : Void {
-		untyped h["$"+key] = value;
-	}
-
-	public function get( key : String ) : Null<T> {
-		return untyped h["$"+key];
-	}
-
-	public function exists( key : String ) : Bool {
-		return untyped h["hasOwnProperty"]("$"+key);
-	}
-
-	public function remove( key : String ) : Bool {
-		key = "$"+key;
-		if( untyped !h["hasOwnProperty"](key) ) return false;
-		untyped __delete__(h,key);
-		return true;
-	}
-
-	public function keys() : Iterator<String> {
-		return untyped (__hkeys__(h))["iterator"]();
-	}
-
-	public function iterator() : Iterator<T> {
-		return untyped {
-			ref : h,
-			it : __keys__(h)["iterator"](),
-			hasNext : function() { return __this__.it[__unprotect__("hasNext")](); },
-			next : function() { var i = __this__.it[__unprotect__("next")](); return __this__.ref[i]; }
-		};
-	}
-
-	public function toString() : String {
-		var s = new StringBuf();
-		s.add("{");
-		var it = keys();
-		for( i in it ) {
-			s.add(i);
-			s.add(" => ");
-			s.add(Std.string(get(i)));
-			if( it.hasNext() )
-				s.add(", ");
-		}
-		s.add("}");
-		return s.toString();
-	}
-
-}

+ 0 - 46
std/flash8/display/BitmapData.hx

@@ -1,46 +0,0 @@
-package flash.display;
-
-import flash.geom.Rectangle;
-import flash.geom.Point;
-
-extern class BitmapData {
-
-	static function loadBitmap( id : String ) : BitmapData;
-
-	var width : Int;
-	var height : Int;
-	var rectangle : Rectangle<Int>;
-	var transparent : Bool;
-
-	function new( width : Int, height : Int, ?transparent : Bool, ?fillcolor : Int ) : Void;
-
-	function getPixel( x : Int, y : Int ) : Int;
-	function setPixel( x : Int, y : Int, color : Int ) : Void;
-	function getPixel32( x : Int, y : Int ) : Int;
-	function setPixel32( x : Int, y : Int, color : Int ) : Void;
-
-	function fillRect( r : Rectangle<Int>, color : Int ) : Void;
-	function copyPixels( src : BitmapData, srcRect : Rectangle<Int>, dst : Point<Int>, ?alpha : BitmapData, ?alphaPos : Point<Int>, ?mergeAlpha : Bool ) : Void;
-	function applyFilter( source : BitmapData, sourceRect : Rectangle<Int>, dest : Point<Int>, filter : flash.filters.BitmapFilter ) : Int;
-	function scroll( dx : Int, dy : Int ) : Void;
-	function threshold( src : BitmapData , srcRect : Rectangle<Int>, dstPoint : Point<Int>, op : String, threshold : Int, ?color : Int, ?mask : Int, ?copy : Bool ) : Int;
-	function draw( source : Dynamic, ?matrix : flash.geom.Matrix, ?colortrans : flash.geom.ColorTransform, ?blendMode : Dynamic, ?clipRect : Rectangle<Int>, ?smooth : Bool) : Void;
-	function pixelDissolve( src : BitmapData, srcRect : Rectangle<Int>, dst : Point<Int>, ?seed : Int, ?npixels : Int, ?fillColor : Int ) : Int;
-	function floodFill( x : Int, y : Int, color : Int ) : Void;
-	function getColorBoundsRect( mask : Int, color : Int, ?fillColor : Bool ) : Rectangle<Int>;
-	function perlinNoise( x : Int, y : Int, num : Int, seed : Int, stitch : Bool, noise : Bool, ?channels : Int, ?gray : Bool, ?offsets : Array<Point<Float>> ) : Void;
-	function colorTransform( r : Rectangle<Int>, trans : flash.geom.ColorTransform ) : Void;
-	function hitTest( firstPoint : Point<Int>, firstAlpha : Int, object : Dynamic, ?secondPoint : Point<Int>, ?secondAlpha : Int ) : Bool;
-	function paletteMap( source : BitmapData, srcRect : Rectangle<Int>, dst : Point<Int>, ?reds : Array<Dynamic>, ?greens : Array<Dynamic>, ?blues : Array<Dynamic>, ?alphas : Array<Dynamic> ) : Void;
-	function merge( src : BitmapData, srcRect : Rectangle<Int>, dst : Point<Int>, redMult : Int, greenMult : Int, blueMult : Int, alphaMult : Int ) : Void;
-	function noise( seed : Int, ?low : Int, ?high : Int, ?channels : Int, ?gray : Bool ) : Void;
-	function copyChannel( source : BitmapData, sourceRect : Rectangle<Int>, dest : Point<Int>, sourceChannel : Int, destChannel : Int ) : Void;
-	function clone() : BitmapData;
-	function dispose() : Void;
-	function generateFilterRect(sourceRect : Rectangle<Int>, filter : flash.filters.BitmapFilter ) : Rectangle<Int>;
-
-	/** FP9 only **/
-	function compare( b : BitmapData ) : BitmapData; // WTF ?
-
-}
-

+ 0 - 10
std/flash8/external/ExternalInterface.hx

@@ -1,10 +0,0 @@
-package flash.external;
-
-extern class ExternalInterface {
-
-	static var available : Bool;
-	static var marshallExceptions : Bool;
-	static function addCallback( methodName : String, instance : Dynamic, method : Dynamic ) : Bool;
-	static function call( methodName : String, ?p1 : Dynamic, ?p2 : Dynamic, ?p3 : Dynamic, ?p4 : Dynamic, ?p5 : Dynamic, ?p6 : Dynamic, ?p7 : Dynamic, ?p8 : Dynamic, ?p9 : Dynamic ) : Dynamic;
-
-}

+ 0 - 21
std/flash8/filters/BevelFilter.hx

@@ -1,21 +0,0 @@
-package flash.filters;
-
-extern class BevelFilter extends BitmapFilter {
-
-	var type : String;
-	var blurX : Float;
-	var blurY : Float;
-	var knockout : Bool;
-	var strength : Float;
-	var quality : Float;
-	var shadowAlpha : Float;
-	var shadowColor : Float;
-	var highlightAlpha : Float;
-	var highlightColor : Float;
-	var angle : Float;
-	var distance : Float;
-
-	function new( ?distance : Float, ?angle : Float, ?highlightColor : Float, ?highlightAlpha : Float, ?shadowColor : Float, ?shadowAlpha : Float, ?blurX : Float, ?blurY : Float, ?strength : Float, ?quality : Float, ?type : String, ?knockout : Bool) : Void;
-	function clone() : BevelFilter;
-
-}

+ 0 - 5
std/flash8/filters/BitmapFilter.hx

@@ -1,5 +0,0 @@
-package flash.filters;
-
-extern class BitmapFilter {
-
-}

+ 0 - 12
std/flash8/filters/BlurFilter.hx

@@ -1,12 +0,0 @@
-package flash.filters;
-
-extern class BlurFilter extends BitmapFilter {
-
-	var quality : Float;
-	var blurX : Float;
-	var blurY : Float;
-
-	function new( ?blurX : Float, ?blurY : Float, ?quality : Float ) : Void;
-	function clone() : BlurFilter;
-
-}

+ 0 - 10
std/flash8/filters/ColorMatrixFilter.hx

@@ -1,10 +0,0 @@
-package flash.filters;
-
-extern class ColorMatrixFilter extends BitmapFilter {
-
-	var matrix : Array<Float>; // 20 Numbers
-
-	function new( ?matrix : Array<Dynamic> ) : Void;
-	function clone() : ColorMatrixFilter;
-
-}

+ 0 - 18
std/flash8/filters/ConvolutionFilter.hx

@@ -1,18 +0,0 @@
-package flash.filters;
-
-extern class ConvolutionFilter extends BitmapFilter {
-
-	var alpha : Float;
-	var color : Float;
-	var clamp : Bool;
-	var preserveAlpha : Bool;
-	var bias : Float;
-	var divisor : Float;
-	var matrix : Array<Dynamic>;
-	var matrixX : Float;
-	var matrixY : Float;
-
-	function new( ?matrixX : Float, ?matrixY : Float, ?matrix : Array<Dynamic>, ?divisor : Float, ?bias : Float, ?preserveAlpha : Bool, ?clamp : Bool, ?color : Float, ?alpha : Float) : Void;
-	function clone() : ConvolutionFilter;
-
-}

+ 0 - 18
std/flash8/filters/DisplacementMapFilter.hx

@@ -1,18 +0,0 @@
-package flash.filters;
-
-extern class DisplacementMapFilter extends BitmapFilter {
-
-	var alpha : Float;
-	var color : Float;
-	var mode : String;
-	var scaleX : Float;
-	var scaleY : Float;
-	var componentX : Float;
-	var componentY : Float;
-	var mapPoint : flash.geom.Point<Float>;
-	var mapBitmap : flash.display.BitmapData;
-
-	function new( ?mapBitmap : flash.display.BitmapData, ?mapPoint : flash.geom.Point<Float>, ?componentX : Float, ?componentY : Float, ?scaleX : Float, ?scaleY : Float, ?mode : String, ?color : Float, ?alpha : Float ) : Void;
-	function clone() : DisplacementMapFilter;
-
-}

+ 0 - 20
std/flash8/filters/DropShadowFilter.hx

@@ -1,20 +0,0 @@
-package flash.filters;
-
-extern class DropShadowFilter extends BitmapFilter {
-
-	var hideObject : Bool;
-	var blurX : Float;
-	var blurY : Float;
-	var knockout : Bool;
-	var strength : Float;
-	var inner : Bool;
-	var quality : Float;
-	var alpha : Float;
-	var color : Float;
-	var angle : Float;
-	var distance : Float;
-
-	function new( ?distance : Float, ?angle : Float, ?color : Float, ?alpha : Float, ?blurX : Float, ?blurY : Float, ?strength : Float, ?quality : Float, ?inner : Bool, ?knockout : Bool, ?hideObject : Bool ) : Void;
-	function clone() : DropShadowFilter;
-
-}

+ 0 - 17
std/flash8/filters/GlowFilter.hx

@@ -1,17 +0,0 @@
-package flash.filters;
-
-extern class GlowFilter extends BitmapFilter {
-
-	var blurX : Float;
-	var blurY : Float;
-	var knockout : Bool;
-	var strength : Float;
-	var quality : Float;
-	var inner : Bool;
-	var alpha : Float;
-	var color : Float;
-
-	function new( ?color : Float, ?alpha : Float, ?blurX : Float, ?blurY : Float, ?strength : Float, ?quality : Float, ?inner : Bool, ?knockout : Bool ) : Void;
-	function clone() : GlowFilter;
-
-}

+ 0 - 20
std/flash8/filters/GradientBevelFilter.hx

@@ -1,20 +0,0 @@
-package flash.filters;
-
-extern class GradientBevelFilter extends BitmapFilter {
-
-	var type : String;
-	var knockout : Bool;
-	var strength : Float;
-	var quality : Float;
-	var blurX : Float;
-	var blurY : Float;
-	var ratios : Array<Dynamic>;
-	var alphas : Array<Dynamic>;
-	var colors : Array<Dynamic>;
-	var angle : Float;
-	var distance : Float;
-
-	function new( ?distance : Float, ?angle : Float, ?colors : Array<Dynamic>, ?alphas : Array<Dynamic>, ?ratios : Array<Dynamic>, ?blurX : Float, ?blurY : Float, ?strength : Float, ?quality : Float, ?type : String, ?knockout : Bool ) : Void;
-	function clone() : GradientBevelFilter;
-
-}

+ 0 - 20
std/flash8/filters/GradientGlowFilter.hx

@@ -1,20 +0,0 @@
-package flash.filters;
-
-extern class GradientGlowFilter extends BitmapFilter {
-
-	var type : String;
-	var knockout : Bool;
-	var strength : Float;
-	var quality : Float;
-	var blurX : Float;
-	var blurY : Float;
-	var ratios : Array<Float>;
-	var alphas : Array<Float>;
-	var colors : Array<Float>;
-	var angle : Float;
-	var distance : Float;
-
-	function new( ?distance : Float, ?angle : Float, ?colors : Array<Dynamic>, ?alphas : Array<Dynamic>, ?ratios : Array<Dynamic>, ?blurX : Float, ?blurY : Float, ?strength : Float, ?quality : Float, ?type : String, ?knockout : Bool ) : Void;
-	function clone() : GradientGlowFilter;
-
-}

+ 0 - 19
std/flash8/geom/ColorTransform.hx

@@ -1,19 +0,0 @@
-package flash.geom;
-
-extern class ColorTransform {
-
-	var rgb : Float;
-	var blueOffset : Float;
-	var greenOffset : Float;
-	var redOffset : Float;
-	var alphaOffset : Float;
-	var blueMultiplier : Float;
-	var greenMultiplier : Float;
-	var redMultiplier : Float;
-	var alphaMultiplier : Float;
-
-	function new( ?rm : Float, ?gm : Float, ?bm : Float, ?am : Float, ?ro : Float, ?go : Float, ?bo : Float, ?ao : Float ) : Void;
-	function toString() : String;
-	function concat( c : ColorTransform ) : Void;
-
-}

+ 0 - 30
std/flash8/geom/Matrix.hx

@@ -1,30 +0,0 @@
-package flash.geom;
-
-extern class Matrix {
-
-	// 3x2 affine 2D matrix
-	var a : Float;
-	var b : Float;
-	var c : Float;
-	var d : Float;
-	var tx : Float;
-	var ty : Float;
-
-	function new( ?a : Float, ?b : Float, ?c : Float, ?d : Float, ?tx : Float, ?ty : Float) : Void;
-
-	function transformPoint( p : Point<Float> ) : Point<Float>;
-	function deltaTransformPoint( p : Point<Float> ) : Point<Float>;
-	function toString() : String;
-	function scale( sx : Float, sy : Float ) : Void;
-	function translate( tx : Float, ty : Float ) : Void;
-	function rotate( r : Float ) : Void;
-	function identity() : Void;
-	function invert() : Void;
-	function concat( m : Matrix ) : Void;
-	function clone() : Matrix;
-
-	function createGradientBox( width : Float, height : Float, ?rot : Float, ?tx : Float, ?ty : Float ) : Void;
-	function createBox( scalex : Float, scaley : Float, ?rot : Float, ?tx : Float, ?ty : Float ) : Void;
-
-
-}

+ 0 - 23
std/flash8/geom/Point.hx

@@ -1,23 +0,0 @@
-package flash.geom;
-
-extern class Point<T> {
-
-	var x : T;
-	var y : T;
-	var length : Float;
-
-	function new( x : T, y : T ) : Void;
-
-	function normalize( length : T ) : Void;
-	function add( p : Point<T> ) : Point<T>;
-	function subtract( p : Point<T> ) : Point<T>;
-	function equals( p : Point<T> ) : Bool;
-	function offset( dx : T, dy : T ) : Void;
-	function clone() : Point<T>;
-	function toString() : String;
-
-	static function distance<T>( p1 : Point<T>, p2 : Point<T> ) : T;
-	static function interpolate<T>( p1 : Point<T>, p2 : Point<T>, f : T ) : Point<T>;
-	static function polar<T>( dist : T, angle : T ) : Point<T>;
-
-}

+ 0 - 41
std/flash8/geom/Rectangle.hx

@@ -1,41 +0,0 @@
-package flash.geom;
-
-extern class Rectangle<T> {
-
-	var left : T;
-	var top : T;
-	var right : T;
-	var bottom : T;
-
-	// OR
-	var x : T;
-	var y : T;
-	var width : T;
-	var height : T;
-
-	// OR
-	var size : Point<T>;
-	var bottomRight : Point<T>;
-	var topLeft : Point<T>;
-
-	function new( x : T, y : T, w : T, h : T ) : Void;
-
-	function equals( r : Rectangle<T> ) : Bool;
-	function union( r : Rectangle<T> ) : Rectangle<T>;
-	function intersects( r : Rectangle<T> ) : Bool;
-	function intersection( r : Rectangle<T> ) : Rectangle<T>;
-	function containsRectangle( r : Rectangle<T> ) : Bool;
-	function containsPoint( p : Point<T> ) : Bool;
-	function contains( x : Float, y : Float ) : Bool;
-	function offsetPoint( p : Point<T> ) : Void;
-	function offset( x : T, y : T ) : Void;
-
-	function inflatePoint( p : Point<T> ) : Void;
-	function inflate( x : T, y : T ) : Void;
-	function isEmpty() : Bool;
-	function setEmpty() : Void;
-	function clone() : Rectangle<T>;
-
-	function toString() : String;
-
-}

+ 0 - 13
std/flash8/geom/Transform.hx

@@ -1,13 +0,0 @@
-package flash.geom;
-
-extern class Transform {
-
-	var matrix : Matrix;
-	var concatenatedMatrix : Matrix;
-	var colorTransform : ColorTransform;
-	var concatenatedColorTransform : ColorTransform;
-	var pixelBounds : Rectangle<Float>;
-
-	function new( mc : flash.MovieClip ) : Void;
-
-}

+ 0 - 23
std/flash8/net/FileReference.hx

@@ -1,23 +0,0 @@
-package flash.net;
-
-extern class FileReference {
-
-	var creator : String;
-	var creationDate : Date;
-	var modificationDate : Date;
-	var size : Float;
-	var type : String;
-	var name : String;
-	var postData : String;
-
-	function new() : Void;
-
-	function browse( ?typeList : Array<Dynamic> ) : Bool;
-	function upload( url : String ) : Bool;
-	function download( url : String, ?defaultName : String ) : Bool;
-	function cancel() : Void;
-
-	function addListener( listener : Dynamic ) : Void;
-	function removeListener( listener : Dynamic ) : Bool;
-
-}

+ 0 - 13
std/flash8/net/FileReferenceList.hx

@@ -1,13 +0,0 @@
-package flash.net;
-
-extern class FileReferenceList {
-
-	var fileList : Array<Dynamic>;
-
-	function new() : Void;
-
-	function browse( ?typeList : Array<Dynamic> ) : Bool;
-	function addListener( listener : Dynamic ) : Void;
-	function removeListener( listener : Dynamic ) : Bool;
-
-}

+ 0 - 61
std/flash8/system/Capabilities.hx

@@ -1,61 +0,0 @@
-package flash.system;
-
-extern class Capabilities
-{
-	static var hasAudio:Bool;
-	static var hasMP3:Bool;
-	static var hasAudioEncoder:Bool;
-	static var hasVideoEncoder:Bool;
-	static var screenResolutionX:Float;
-	static var screenResolutionY:Float;
-	static var screenDPI:Float;
-	static var screenColor:String;
-	static var pixelAspectRatio:Float;
-	static var hasAccessibility:Bool;
-	static var input:String;
-	static var isDebugger:Bool;
-	static var language:String;
-	static var manufacturer:String;
-	static var os:String;
-	static var serverString:String;
-	static var version:String;
-	static var hasPrinting:Bool;
-	static var playerType:String;
-	static var hasStreamingAudio:Bool;
-	static var hasScreenBroadcast:Bool;
-	static var hasScreenPlayback:Bool;
-	static var hasStreamingVideo:Bool;
-	static var hasEmbeddedVideo:Bool;
-	static var avHardwareDisable:Bool;
-	static var localFileReadDisable:Bool;
-	static var windowlessDisable:Bool;
-
-	#if flash_lite
-	static var hasCompoundSound:Bool;
-	static var hasEmail:Bool;
-	static var hasMMS:Bool;
-	static var hasSMS:Bool;
-	static var hasMFI:Bool;
-	static var hasMIDI:Bool;
-	static var hasSMAF:Bool;
-	static var hasDataLoading:Bool;
-	static var has4WayKeyAS:Bool;
-	static var hasMouse:Bool;
-	static var hasMappableSoftKeys:Bool;
-	static var hasCMIDI:Bool;
-	static var hasStylus:Bool;
-	static var screenOrientation:String;
-	static var hasSharedObjects:Bool;
-	static var hasQWERTYKeyboard:Bool;
-	static var softKeyCount:Float;
-	static var audioMIMETypes:Array<String>;
-	static var imageMIMETypes:Array<String>;
-	static var videoMIMETypes:Array<String>;
-	static var MIMETypes:String;
-	#end
-
-	private static function __init__() : Void untyped {
-		flash.system.Capabilities = _global["System"]["capabilities"];
-	}
-
-}

+ 0 - 27
std/flash8/system/IME.hx

@@ -1,27 +0,0 @@
-package flash.system;
-
-extern class IME {
-
-	static var ALPHANUMERIC_FULL : String;
-	static var ALPHANUMERIC_HALF : String;
-	static var CHINESE : String;
-	static var JAPANESE_HIRAGANA : String;
-	static var JAPANESE_KATAKANA_FULL : String;
-	static var JAPANESE_KATAKANA_HALF : String;
-	static var KOREAN : String;
-	static var UNKNOWN : String;
-
-	static function getEnabled() : Bool;
-	static function setEnabled(enabled:Bool) : Bool;
-	static function getConversionMode() : String;
-	static function setConversionMode(mode:String) : Bool;
-	static function setCompositionString (composition:String) : Bool;
-	static function doConversion() : Bool;
-	static function addListener(listener:Dynamic) : Void;
-	static function removeListener(listener:Dynamic) : Bool;
-
-	private static function __init__() : Void untyped {
-		flash.system.IME = _global["System"]["IME"];
-	}
-
-}

+ 0 - 17
std/flash8/system/Security.hx

@@ -1,17 +0,0 @@
-package flash.system;
-
-extern class Security
-{
-	static function allowDomain( domain : String ):Void;
-	static function allowInsecureDomain( domain : String ):Void;
-	static function loadPolicyFile(url:String):Void;
-
-	#if flash8
-	static var sandboxType(default,null) : String;
-	#end
-
-	private static function __init__() : Void untyped {
-		flash.system.Security = _global["System"]["security"];
-	}
-
-}

+ 0 - 20
std/flash8/text/StyleSheet.hx

@@ -1,20 +0,0 @@
-package flash.text;
-
-extern class StyleSheet
-{
-	function new() : Void;
-	function getStyle(name:String):Dynamic;
-	function setStyle(name:String,style:Dynamic):Void;
-	function clear():Void;
-	function getStyleNames():Array<Dynamic>;
-	function transform(style:Dynamic):flash.TextFormat;
-	function parseCSS(cssText:String):Bool;
-	function parse(cssText:String):Bool;
-	function load(url:String):Bool;
-	dynamic function onLoad(success:Bool):Void;
-
-	private static function __init__() : Void untyped {
-		flash.text.StyleSheet = _global["TextField"]["StyleSheet"];
-	}
-
-}

+ 0 - 8
std/flash8/text/TextRenderer.hx

@@ -1,8 +0,0 @@
-package flash.text;
-
-extern class TextRenderer {
-
-	static var maxLevel : Float;
-	static function setAdvancedAntialiasingTable( fontName : String, fontStyle: String, colorType : String, advancedAntialiasingTable : Array<Dynamic> ) : Void;
-
-}

+ 4 - 16
std/haxe/CallStack.hx

@@ -45,12 +45,10 @@ class CallStack {
 			var a = makeStack(untyped __dollar__callstack());
 			var a = makeStack(untyped __dollar__callstack());
 			a.shift(); // remove Stack.callStack()
 			a.shift(); // remove Stack.callStack()
 			return a;
 			return a;
-		#elseif flash9
+		#elseif flash
 			var a = makeStack( new flash.errors.Error().getStackTrace() );
 			var a = makeStack( new flash.errors.Error().getStackTrace() );
 			a.shift(); // remove Stack.callStack()
 			a.shift(); // remove Stack.callStack()
 			return a;
 			return a;
-		#elseif flash
-			return makeStack("$s");
 		#elseif php
 		#elseif php
 			return makeStack("%s");
 			return makeStack("%s");
 		#elseif cpp
 		#elseif cpp
@@ -129,7 +127,7 @@ class CallStack {
 			return makeStack(untyped __dollar__excstack());
 			return makeStack(untyped __dollar__excstack());
 		#elseif as3
 		#elseif as3
 			return new Array();
 			return new Array();
-		#elseif flash9
+		#elseif flash
 			var err : flash.errors.Error = untyped flash.Boot.lastError;
 			var err : flash.errors.Error = untyped flash.Boot.lastError;
 			if( err == null ) return new Array();
 			if( err == null ) return new Array();
 			var a = makeStack( err.getStackTrace() );
 			var a = makeStack( err.getStackTrace() );
@@ -143,8 +141,6 @@ class CallStack {
 				i--;
 				i--;
 			}
 			}
 			return a;
 			return a;
-		#elseif flash
-			return makeStack("$e");
 		#elseif php
 		#elseif php
 			return makeStack("%e");
 			return makeStack("%e");
 		#elseif cpp
 		#elseif cpp
@@ -241,7 +237,7 @@ class CallStack {
 					a.unshift(FilePos(null,new String(untyped x[0]),untyped x[1]));
 					a.unshift(FilePos(null,new String(untyped x[0]),untyped x[1]));
 			}
 			}
 			return a;
 			return a;
-		#elseif flash9
+		#elseif flash
 			var a = new Array();
 			var a = new Array();
 			var r = ~/at ([^\/]+?)\$?(\/[^\(]+)?\(\)(\[(.*?):([0-9]+)\])?/;
 			var r = ~/at ([^\/]+?)\$?(\/[^\(]+)?\(\)(\[(.*?):([0-9]+)\])?/;
 			var rlambda = ~/^MethodInfo-([0-9]+)$/g;
 			var rlambda = ~/^MethodInfo-([0-9]+)$/g;
@@ -262,14 +258,6 @@ class CallStack {
 				s = r.matchedRight();
 				s = r.matchedRight();
 			}
 			}
 			return a;
 			return a;
-		#elseif flash
-			var a : Array<String> = untyped __eval__(s);
-			var m = new Array();
-			for( i in 0...a.length - if(s == "$s") 2 else 0 ) {
-				var d = a[i].split("::");
-				m.unshift(Method(d[0],d[1]));
-			}
-			return m;
 		#elseif php
 		#elseif php
 			if (!untyped __call__("isset", __var__("GLOBALS", s)))
 			if (!untyped __call__("isset", __var__("GLOBALS", s)))
 				return [];
 				return [];
@@ -297,7 +285,7 @@ class CallStack {
 			if ((untyped __js__("typeof"))(s) == "string") {
 			if ((untyped __js__("typeof"))(s) == "string") {
 				// Return the raw lines in browsers that don't support prepareStackTrace
 				// Return the raw lines in browsers that don't support prepareStackTrace
 				var stack : Array<String> = s.split("\n");
 				var stack : Array<String> = s.split("\n");
-				if( stack[0] == "Error" ) stack.shift(); 
+				if( stack[0] == "Error" ) stack.shift();
 				var m = [];
 				var m = [];
 				var rie10 = ~/^   at ([A-Za-z0-9_. ]+) \(([^)]+):([0-9]+):([0-9]+)\)$/;
 				var rie10 = ~/^   at ([A-Za-z0-9_. ]+) \(([^)]+):([0-9]+):([0-9]+)\)$/;
 				for( line in stack ) {
 				for( line in stack ) {

+ 4 - 44
std/haxe/Http.hx

@@ -136,7 +136,6 @@ class Http {
 		return this;
 		return this;
 	}
 	}
 
 
-	#if !flash8
 	/**
 	/**
 		Sets the post data of `this` Http request to `data`.
 		Sets the post data of `this` Http request to `data`.
 
 
@@ -151,13 +150,12 @@ class Http {
 		postData = data;
 		postData = data;
 		return this;
 		return this;
 	}
 	}
-	#end
 
 
-	#if (js || flash9)
+	#if (js || flash)
 
 
 	#if js
 	#if js
 	var req:js.html.XMLHttpRequest;
 	var req:js.html.XMLHttpRequest;
-	#elseif flash9
+	#elseif flash
 	var req:flash.net.URLLoader;
 	var req:flash.net.URLLoader;
 	#end
 	#end
 
 
@@ -170,7 +168,7 @@ class Http {
 		if (req == null) return;
 		if (req == null) return;
 		#if js
 		#if js
 		req.abort();
 		req.abort();
-		#elseif flash9
+		#elseif flash
 		req.close();
 		req.close();
 		#end
 		#end
 		req = null;
 		req = null;
@@ -271,7 +269,7 @@ class Http {
 		r.send(uri);
 		r.send(uri);
 		if( !async )
 		if( !async )
 			onreadystatechange(null);
 			onreadystatechange(null);
-	#elseif flash9
+	#elseif flash
 		me.responseData = null;
 		me.responseData = null;
 		var loader = req = new flash.net.URLLoader();
 		var loader = req = new flash.net.URLLoader();
 		loader.addEventListener( "complete", function(e) {
 		loader.addEventListener( "complete", function(e) {
@@ -330,44 +328,6 @@ class Http {
 			me.req = null;
 			me.req = null;
 			onError("Exception: "+Std.string(e));
 			onError("Exception: "+Std.string(e));
 		}
 		}
-	#elseif flash
-		me.responseData = null;
-		var r = new flash.LoadVars();
-		// on Firefox 1.5, onData is not called if host/port invalid (!)
-		r.onData = function(data) {
-			if( data == null ) {
-				me.onError("Failed to retrieve url");
-				return;
-			}
-			me.responseData = data;
-			me.onData(data);
-		};
-		#if flash8
-		r.onHTTPStatus = function(status) {
-			// on Firefox 1.5, Flash calls onHTTPStatus with 0 (!??)
-			if( status != 0 )
-				me.onStatus(status);
-		};
-		untyped ASSetPropFlags(r,"onHTTPStatus",7);
-		#end
-		untyped ASSetPropFlags(r,"onData",7);
-		for( h in headers )
-			r.addRequestHeader(h.header,h.value);
-		var param = false;
-		for( p in params ) {
-			param = true;
-			Reflect.setField(r,p.param,p.value);
-		}
-		var small_url = url;
-		if( param && !post ) {
-			var k = url.split("?");
-			if( k.length > 1 ) {
-				small_url = k.shift();
-				r.decode(k.join("?"));
-			}
-		}
-		if( !r.sendAndLoad(small_url,r,if( param ) { if( post ) "POST" else "GET"; } else null) )
-			onError("Failed to initialize Connection");
 	#elseif sys
 	#elseif sys
 		var me = this;
 		var me = this;
 		var output = new haxe.io.BytesOutput();
 		var output = new haxe.io.BytesOutput();

+ 2 - 2
std/haxe/Int32.hx

@@ -67,7 +67,7 @@ abstract Int32(Int) from Int to Int {
 
 
 	@:op(A - B) public static function floatSub(a:Float, b:Int32):Float;
 	@:op(A - B) public static function floatSub(a:Float, b:Int32):Float;
 
 
-	#if (as3 || flash8 || js || php || python)
+	#if (as3 || js || php || python)
 
 
 	@:op(A * B) private static function mul(a:Int32, b:Int32):Int32
 	@:op(A * B) private static function mul(a:Int32, b:Int32):Int32
 		return clamp( (a : Int) * ((b : Int) & 0xFFFF) + clamp( (a : Int) * ((b : Int) >>> 16) << 16 ) );
 		return clamp( (a : Int) * ((b : Int) & 0xFFFF) + clamp( (a : Int) * ((b : Int) >>> 16) << 16 ) );
@@ -186,7 +186,7 @@ abstract Int32(Int) from Int to Int {
 
 
 	static inline function clamp( x : Int ) : Int {
 	static inline function clamp( x : Int ) : Int {
 		// force to-int conversion on platforms that require it
 		// force to-int conversion on platforms that require it
-		#if (as3 || flash8 || js)
+		#if (as3 || js)
 		return x | 0;
 		return x | 0;
 		#elseif php
 		#elseif php
 		// we might be on 64-bit php, so sign extend from 32-bit
 		// we might be on 64-bit php, so sign extend from 32-bit

+ 1 - 1
std/haxe/Log.hx

@@ -48,7 +48,7 @@ class Log {
 				var pstr = infos == null ? "(null)" : infos.fileName + ":" + infos.lineNumber;
 				var pstr = infos == null ? "(null)" : infos.fileName + ":" + infos.lineNumber;
 				var str = flash.Boot.__string_rec(v, "");
 				var str = flash.Boot.__string_rec(v, "");
 				if( infos != null && infos.customParams != null ) for( v in infos.customParams ) str += "," + flash.Boot.__string_rec(v, "");
 				if( infos != null && infos.customParams != null ) for( v in infos.customParams ) str += "," + flash.Boot.__string_rec(v, "");
-				untyped #if flash9 __global__["trace"] #else __trace__ #end(pstr+": "+str);
+				untyped __global__["trace"](pstr+": "+str);
 			#else
 			#else
 				untyped flash.Boot.__trace(v,infos);
 				untyped flash.Boot.__trace(v,infos);
 			#end
 			#end

+ 10 - 10
std/haxe/Serializer.hx

@@ -188,7 +188,7 @@ class Serializer {
 		return false;
 		return false;
 	}
 	}
 
 
-	#if flash9
+	#if flash
 	// only the instance variables
 	// only the instance variables
 
 
 	function serializeClassFields(v,c) {
 	function serializeClassFields(v,c) {
@@ -258,10 +258,10 @@ class Serializer {
 			case #if (neko || cs || python) "Array" #else cast Array #end:
 			case #if (neko || cs || python) "Array" #else cast Array #end:
 				var ucount = 0;
 				var ucount = 0;
 				buf.add("a");
 				buf.add("a");
-				#if (flash9 || python)
+				#if (flash || python)
 				var v : Array<Dynamic> = v;
 				var v : Array<Dynamic> = v;
 				#end
 				#end
-				var l = #if (neko || flash9 || php || cs || java || python) v.length #elseif cpp v.__length() #else __getField(v, "length") #end;
+				var l = #if (neko || flash || php || cs || java || python) v.length #elseif cpp v.__length() #else __getField(v, "length") #end;
 				for( i in 0...l ) {
 				for( i in 0...l ) {
 					if( v[i] == null )
 					if( v[i] == null )
 						ucount++;
 						ucount++;
@@ -318,7 +318,7 @@ class Serializer {
 				buf.add("M");
 				buf.add("M");
 				var v : haxe.ds.ObjectMap<Dynamic,Dynamic> = v;
 				var v : haxe.ds.ObjectMap<Dynamic,Dynamic> = v;
 				for ( k in v.keys() ) {
 				for ( k in v.keys() ) {
-					#if (js || flash8 || neko)
+					#if (js || neko)
 					var id = Reflect.field(k, "__id__");
 					var id = Reflect.field(k, "__id__");
 					Reflect.deleteField(k, "__id__");
 					Reflect.deleteField(k, "__id__");
 					serialize(k);
 					serialize(k);
@@ -367,7 +367,7 @@ class Serializer {
 				buf.add(chars);
 				buf.add(chars);
 			default:
 			default:
 				if( useCache ) cache.pop();
 				if( useCache ) cache.pop();
-				if( #if flash9 try v.hxSerialize != null catch( e : Dynamic ) false #elseif (cs || java || python) Reflect.hasField(v, "hxSerialize") #else v.hxSerialize != null #end  ) {
+				if( #if flash try v.hxSerialize != null catch( e : Dynamic ) false #elseif (cs || java || python) Reflect.hasField(v, "hxSerialize") #else v.hxSerialize != null #end  ) {
 					buf.add("C");
 					buf.add("C");
 					serializeString(Type.getClassName(c));
 					serializeString(Type.getClassName(c));
 					if( useCache ) cache.push(v);
 					if( useCache ) cache.push(v);
@@ -377,7 +377,7 @@ class Serializer {
 					buf.add("c");
 					buf.add("c");
 					serializeString(Type.getClassName(c));
 					serializeString(Type.getClassName(c));
 					if( useCache ) cache.push(v);
 					if( useCache ) cache.push(v);
-					#if flash9
+					#if flash
 					serializeClassFields(v,c);
 					serializeClassFields(v,c);
 					#else
 					#else
 					serializeFields(v);
 					serializeFields(v);
@@ -387,8 +387,8 @@ class Serializer {
 		case TObject:
 		case TObject:
 			if (Std.is(v,Class)) {
 			if (Std.is(v,Class)) {
 				var className = Type.getClassName(v);
 				var className = Type.getClassName(v);
-				#if (flash9 || cpp)
-				// Currently, Enum and Class are the same for flash9 and cpp.
+				#if (flash || cpp)
+				// Currently, Enum and Class are the same for flash and cpp.
 				//  use resolveEnum to test if it is actually an enum
 				//  use resolveEnum to test if it is actually an enum
 				if (Type.resolveEnum(className)!=null) buf.add("B") else
 				if (Type.resolveEnum(className)!=null) buf.add("B") else
 				#end
 				#end
@@ -426,7 +426,7 @@ class Serializer {
 				for( i in 0...l )
 				for( i in 0...l )
 					serialize(v.args[i]);
 					serialize(v.args[i]);
 			}
 			}
-			#elseif flash9
+			#elseif flash
 			if( useEnumIndex ) {
 			if( useEnumIndex ) {
 				buf.add(":");
 				buf.add(":");
 				var i : Int = v.index;
 				var i : Int = v.index;
@@ -520,7 +520,7 @@ class Serializer {
 
 
 	public function serializeException( e : Dynamic ) {
 	public function serializeException( e : Dynamic ) {
 		buf.add("x");
 		buf.add("x");
-		#if flash9
+		#if flash
 		if( untyped __is__(e,__global__["Error"]) ) {
 		if( untyped __is__(e,__global__["Error"]) ) {
 			var e : flash.errors.Error = e;
 			var e : flash.errors.Error = e;
 			var s = e.getStackTrace();
 			var s = e.getStackTrace();

+ 2 - 7
std/haxe/Timer.hx

@@ -57,12 +57,9 @@ class Timer {
 		The accuracy of this may be platform-dependent.
 		The accuracy of this may be platform-dependent.
 	**/
 	**/
 	public function new( time_ms : Int ){
 	public function new( time_ms : Int ){
-		#if flash9
+		#if flash
 			var me = this;
 			var me = this;
 			id = untyped __global__["flash.utils.setInterval"](function() { me.run(); },time_ms);
 			id = untyped __global__["flash.utils.setInterval"](function() { me.run(); },time_ms);
-		#elseif flash
-			var me = this;
-			id = untyped _global["setInterval"](function() { me.run(); },time_ms);
 		#elseif js
 		#elseif js
 			var me = this;
 			var me = this;
 			id = untyped setInterval(function() me.run(),time_ms);
 			id = untyped setInterval(function() me.run(),time_ms);
@@ -84,10 +81,8 @@ class Timer {
 		#if (flash || js)
 		#if (flash || js)
 			if( id == null )
 			if( id == null )
 				return;
 				return;
-			#if flash9
+			#if flash
 				untyped __global__["flash.utils.clearInterval"](id);
 				untyped __global__["flash.utils.clearInterval"](id);
-			#elseif flash
-				untyped _global["clearInterval"](id);
 			#elseif js
 			#elseif js
 				untyped clearInterval(id);
 				untyped clearInterval(id);
 			#end
 			#end

+ 2 - 2
std/haxe/Unserializer.hx

@@ -66,7 +66,7 @@ class Unserializer {
 
 
 	static function initCodes() {
 	static function initCodes() {
 		var codes =
 		var codes =
-			#if flash9
+			#if flash
 				new flash.utils.ByteArray();
 				new flash.utils.ByteArray();
 			#else
 			#else
 				new Array();
 				new Array();
@@ -168,7 +168,7 @@ class Unserializer {
  			k *= -1;
  			k *= -1;
  		return k;
  		return k;
  	}
  	}
-	
+
 	function readFloat() {
 	function readFloat() {
 		var p1 = pos;
 		var p1 = pos;
  		while( true ) {
  		while( true ) {

+ 2 - 2
std/haxe/ds/GenericStack.hx

@@ -21,7 +21,7 @@
  */
  */
 package haxe.ds;
 package haxe.ds;
 
 
-#if (flash9 || cpp)
+#if (flash || cpp)
 @:generic
 @:generic
 #end
 #end
 class GenericCell<T> {
 class GenericCell<T> {
@@ -54,7 +54,7 @@ private class GenericStackIterator<T> extends cpp.FastIterator<T> {
 	The generated name is an implementation detail and should not be relied
 	The generated name is an implementation detail and should not be relied
 	upon.
 	upon.
 **/
 **/
-#if (flash9 || cpp)
+#if (flash || cpp)
 @:generic
 @:generic
 #end
 #end
 class GenericStack<T> {
 class GenericStack<T> {

+ 1 - 1
std/haxe/ds/Vector.hx

@@ -205,7 +205,7 @@ abstract Vector<T>(VectorData<T>) {
 	static public inline function fromArrayCopy<T>(array:Array<T>):Vector<T> {
 	static public inline function fromArrayCopy<T>(array:Array<T>):Vector<T> {
 		#if python
 		#if python
 		return cast array.copy();
 		return cast array.copy();
-		#elseif flash9
+		#elseif flash
 		return fromData(flash.Vector.ofArray(array));
 		return fromData(flash.Vector.ofArray(array));
 		#elseif java
 		#elseif java
 		return fromData(java.Lib.nativeArray(array,false));
 		return fromData(java.Lib.nativeArray(array,false));

+ 7 - 7
std/haxe/format/JsonPrinter.hx

@@ -45,7 +45,7 @@ class JsonPrinter {
 		return printer.buf.toString();
 		return printer.buf.toString();
 	}
 	}
 
 
-	var buf : #if flash9 flash.utils.ByteArray #else StringBuf #end;
+	var buf : #if flash flash.utils.ByteArray #else StringBuf #end;
 	var replacer : Dynamic -> Dynamic -> Dynamic;
 	var replacer : Dynamic -> Dynamic -> Dynamic;
 	var indent:String;
 	var indent:String;
 	var pretty:Bool;
 	var pretty:Bool;
@@ -57,7 +57,7 @@ class JsonPrinter {
 		this.pretty = space != null;
 		this.pretty = space != null;
 		this.nind = 0;
 		this.nind = 0;
 
 
-		#if flash9
+		#if flash
 		buf = new flash.utils.ByteArray();
 		buf = new flash.utils.ByteArray();
 		buf.endian = flash.utils.Endian.BIG_ENDIAN;
 		buf.endian = flash.utils.Endian.BIG_ENDIAN;
 		buf.position = 0;
 		buf.position = 0;
@@ -120,7 +120,7 @@ class JsonPrinter {
 				var v : Date = v;
 				var v : Date = v;
 				quote(v.toString());
 				quote(v.toString());
 			} else
 			} else
-				#if flash9
+				#if flash
 				classString(v);
 				classString(v);
 				#else
 				#else
 				objString(v);
 				objString(v);
@@ -136,7 +136,7 @@ class JsonPrinter {
 	}
 	}
 
 
 	@:extern inline function addChar(c:Int) {
 	@:extern inline function addChar(c:Int) {
-		#if flash9
+		#if flash
 		buf.writeByte(c);
 		buf.writeByte(c);
 		#else
 		#else
 		buf.addChar(c);
 		buf.addChar(c);
@@ -144,7 +144,7 @@ class JsonPrinter {
 	}
 	}
 
 
 	@:extern inline function add(v:String) {
 	@:extern inline function add(v:String) {
-		#if flash9
+		#if flash
 		// argument is not always a string but will be automatically casted
 		// argument is not always a string but will be automatically casted
 		buf.writeUTFBytes(v);
 		buf.writeUTFBytes(v);
 		#else
 		#else
@@ -152,7 +152,7 @@ class JsonPrinter {
 		#end
 		#end
 	}
 	}
 
 
-	#if flash9
+	#if flash
 	function classString ( v : Dynamic ) {
 	function classString ( v : Dynamic ) {
 		fieldsString(v,Type.getInstanceFields(Type.getClass(v)));
 		fieldsString(v,Type.getInstanceFields(Type.getClass(v)));
 	}
 	}
@@ -209,7 +209,7 @@ class JsonPrinter {
 			case 8: add('\\b');
 			case 8: add('\\b');
 			case 12: add('\\f');
 			case 12: add('\\f');
 			default:
 			default:
-				#if flash9
+				#if flash
 				if( c >= 128 ) add(String.fromCharCode(c)) else addChar(c);
 				if( c >= 128 ) add(String.fromCharCode(c)) else addChar(c);
 				#else
 				#else
 				addChar(c);
 				addChar(c);

+ 17 - 21
std/haxe/io/Bytes.hx

@@ -33,7 +33,7 @@ class Bytes {
 	function new(length,b) {
 	function new(length,b) {
 		this.length = length;
 		this.length = length;
 		this.b = b;
 		this.b = b;
-		#if flash9
+		#if flash
 		b.endian = flash.utils.Endian.LITTLE_ENDIAN;
 		b.endian = flash.utils.Endian.LITTLE_ENDIAN;
 		#end
 		#end
 	}
 	}
@@ -41,7 +41,7 @@ class Bytes {
 	public inline function get( pos : Int ) : Int {
 	public inline function get( pos : Int ) : Int {
 		#if neko
 		#if neko
 		return untyped $sget(b,pos);
 		return untyped $sget(b,pos);
-		#elseif flash9
+		#elseif flash
 		return b[pos];
 		return b[pos];
 		#elseif php
 		#elseif php
 		return untyped __call__("ord", b[pos]);
 		return untyped __call__("ord", b[pos]);
@@ -59,7 +59,7 @@ class Bytes {
 	public inline function set( pos : Int, v : Int ) : Void {
 	public inline function set( pos : Int, v : Int ) : Void {
 		#if neko
 		#if neko
 		untyped $sset(b,pos,v);
 		untyped $sset(b,pos,v);
-		#elseif flash9
+		#elseif flash
 		b[pos] = v;
 		b[pos] = v;
 		#elseif php
 		#elseif php
 		b[pos] = untyped __call__("chr", v);
 		b[pos] = untyped __call__("chr", v);
@@ -84,7 +84,7 @@ class Bytes {
 		try untyped $sblit(b,pos,src.b,srcpos,len) catch( e : Dynamic ) throw Error.OutsideBounds;
 		try untyped $sblit(b,pos,src.b,srcpos,len) catch( e : Dynamic ) throw Error.OutsideBounds;
 		#elseif php
 		#elseif php
 		b = untyped __php__("substr($this->b, 0, $pos) . substr($src->b, $srcpos, $len) . substr($this->b, $pos+$len)"); //__call__("substr", b, 0, pos)+__call__("substr", src.b, srcpos, len)+__call__("substr", b, pos+len);
 		b = untyped __php__("substr($this->b, 0, $pos) . substr($src->b, $srcpos, $len) . substr($this->b, $pos+$len)"); //__call__("substr", b, 0, pos)+__call__("substr", src.b, srcpos, len)+__call__("substr", b, pos+len);
-		#elseif flash9
+		#elseif flash
 		b.position = pos;
 		b.position = pos;
 		if( len > 0 ) b.writeBytes(src.b,srcpos,len);
 		if( len > 0 ) b.writeBytes(src.b,srcpos,len);
 		#elseif java
 		#elseif java
@@ -112,7 +112,7 @@ class Bytes {
 	}
 	}
 
 
 	public function fill( pos : Int, len : Int, value : Int ) {
 	public function fill( pos : Int, len : Int, value : Int ) {
-		#if flash9
+		#if flash
 		var v4 = value&0xFF;
 		var v4 = value&0xFF;
 		v4 |= v4<<8;
 		v4 |= v4<<8;
 		v4 |= v4<<16;
 		v4 |= v4<<16;
@@ -136,7 +136,7 @@ class Bytes {
 		#end
 		#end
 		#if neko
 		#if neko
 		return try new Bytes(len,untyped __dollar__ssub(b,pos,len)) catch( e : Dynamic ) throw Error.OutsideBounds;
 		return try new Bytes(len,untyped __dollar__ssub(b,pos,len)) catch( e : Dynamic ) throw Error.OutsideBounds;
-		#elseif flash9
+		#elseif flash
 		b.position = pos;
 		b.position = pos;
 		var b2 = new flash.utils.ByteArray();
 		var b2 = new flash.utils.ByteArray();
 		b.readBytes(b2,0,len);
 		b.readBytes(b2,0,len);
@@ -161,7 +161,7 @@ class Bytes {
 	public function compare( other : Bytes ) : Int {
 	public function compare( other : Bytes ) : Int {
 		#if neko
 		#if neko
 		return untyped __dollar__compare(b,other.b);
 		return untyped __dollar__compare(b,other.b);
-		#elseif flash9
+		#elseif flash
 		var len = (length < other.length) ? length : other.length;
 		var len = (length < other.length) ? length : other.length;
 		var b1 = b;
 		var b1 = b;
 		var b2 = other.b;
 		var b2 = other.b;
@@ -199,11 +199,7 @@ class Bytes {
 		var len = (length < other.length) ? length : other.length;
 		var len = (length < other.length) ? length : other.length;
 		for( i in 0...len )
 		for( i in 0...len )
 			if( b1[i] != b2[i] )
 			if( b1[i] != b2[i] )
-				#if cpp
 				return untyped b1[i] - untyped b2[i];
 				return untyped b1[i] - untyped b2[i];
-				#else
-				return untyped b1[i] - untyped b2[i];
-				#end
 		return length - other.length;
 		return length - other.length;
 		#end
 		#end
 	}
 	}
@@ -217,7 +213,7 @@ class Bytes {
 	public function getDouble( pos : Int ) : Float {
 	public function getDouble( pos : Int ) : Float {
 		#if neko_v21
 		#if neko_v21
 		return untyped $sgetd(b, pos, false);
 		return untyped $sgetd(b, pos, false);
-		#elseif flash9
+		#elseif flash
 		b.position = pos;
 		b.position = pos;
 		return b.readDouble();
 		return b.readDouble();
 		#elseif cpp
 		#elseif cpp
@@ -236,7 +232,7 @@ class Bytes {
 	public function getFloat( pos : Int ) : Float {
 	public function getFloat( pos : Int ) : Float {
 		#if neko_v21
 		#if neko_v21
 		return untyped $sgetf(b, pos, false);
 		return untyped $sgetf(b, pos, false);
-		#elseif flash9
+		#elseif flash
 		b.position = pos;
 		b.position = pos;
 		return b.readFloat();
 		return b.readFloat();
 		#elseif cpp
 		#elseif cpp
@@ -258,7 +254,7 @@ class Bytes {
 		untyped $ssetd(b, pos, v, false);
 		untyped $ssetd(b, pos, v, false);
 		#elseif neko
 		#elseif neko
 		untyped $sblit(b, pos, FPHelper._double_bytes(v,false), 0, 8);
 		untyped $sblit(b, pos, FPHelper._double_bytes(v,false), 0, 8);
-		#elseif flash9
+		#elseif flash
 		b.position = pos;
 		b.position = pos;
 		b.writeDouble(v);
 		b.writeDouble(v);
 		#elseif cpp
 		#elseif cpp
@@ -281,7 +277,7 @@ class Bytes {
 		untyped $ssetf(b, pos, v, false);
 		untyped $ssetf(b, pos, v, false);
 		#elseif neko
 		#elseif neko
 		untyped $sblit(b, pos, FPHelper._float_bytes(v,false), 0, 4);
 		untyped $sblit(b, pos, FPHelper._float_bytes(v,false), 0, 4);
-		#elseif flash9
+		#elseif flash
 		b.position = pos;
 		b.position = pos;
 		b.writeFloat(v);
 		b.writeFloat(v);
 		#elseif cpp
 		#elseif cpp
@@ -364,7 +360,7 @@ class Bytes {
 		#end
 		#end
 		#if neko
 		#if neko
 		return try new String(untyped __dollar__ssub(b,pos,len)) catch( e : Dynamic ) throw Error.OutsideBounds;
 		return try new String(untyped __dollar__ssub(b,pos,len)) catch( e : Dynamic ) throw Error.OutsideBounds;
-		#elseif flash9
+		#elseif flash
 		b.position = pos;
 		b.position = pos;
 		return b.readUTFBytes(len);
 		return b.readUTFBytes(len);
 		#elseif php
 		#elseif php
@@ -420,7 +416,7 @@ class Bytes {
 	public function toString() : String {
 	public function toString() : String {
 		#if neko
 		#if neko
 		return new String(untyped __dollar__ssub(b,0,length));
 		return new String(untyped __dollar__ssub(b,0,length));
-		#elseif flash9
+		#elseif flash
 		b.position = 0;
 		b.position = 0;
 		return b.readUTFBytes(length);
 		return b.readUTFBytes(length);
 		#elseif php
 		#elseif php
@@ -459,7 +455,7 @@ class Bytes {
 	public static function alloc( length : Int ) : Bytes {
 	public static function alloc( length : Int ) : Bytes {
 		#if neko
 		#if neko
 		return new Bytes(length,untyped __dollar__smake(length));
 		return new Bytes(length,untyped __dollar__smake(length));
-		#elseif flash9
+		#elseif flash
 		var b = new flash.utils.ByteArray();
 		var b = new flash.utils.ByteArray();
 		b.length = length;
 		b.length = length;
 		return new Bytes(length,b);
 		return new Bytes(length,b);
@@ -486,7 +482,7 @@ class Bytes {
 	public static function ofString( s : String ) : Bytes {
 	public static function ofString( s : String ) : Bytes {
 		#if neko
 		#if neko
 		return new Bytes(s.length,untyped __dollar__ssub(s.__s,0,s.length));
 		return new Bytes(s.length,untyped __dollar__ssub(s.__s,0,s.length));
-		#elseif flash9
+		#elseif flash
 		var b = new flash.utils.ByteArray();
 		var b = new flash.utils.ByteArray();
 		b.writeUTFBytes(s);
 		b.writeUTFBytes(s);
 		return new Bytes(b.length,b);
 		return new Bytes(b.length,b);
@@ -542,7 +538,7 @@ class Bytes {
 	}
 	}
 
 
 	public static function ofData( b : BytesData ) {
 	public static function ofData( b : BytesData ) {
-		#if flash9
+		#if flash
 		return new Bytes(b.length,b);
 		return new Bytes(b.length,b);
 		#elseif neko
 		#elseif neko
 		return new Bytes(untyped __dollar__ssize(b),b);
 		return new Bytes(untyped __dollar__ssize(b),b);
@@ -562,7 +558,7 @@ class Bytes {
 	public inline static function fastGet( b : BytesData, pos : Int ) : Int {
 	public inline static function fastGet( b : BytesData, pos : Int ) : Int {
 		#if neko
 		#if neko
 		return untyped __dollar__sget(b,pos);
 		return untyped __dollar__sget(b,pos);
-		#elseif flash9
+		#elseif flash
 		return b[pos];
 		return b[pos];
 		#elseif php
 		#elseif php
 		return untyped __call__("ord", b[pos]);
 		return untyped __call__("ord", b[pos]);

+ 12 - 12
std/haxe/io/BytesBuffer.hx

@@ -25,7 +25,7 @@ class BytesBuffer {
 
 
 	#if neko
 	#if neko
 	var b : Dynamic; // neko string buffer
 	var b : Dynamic; // neko string buffer
-	#elseif flash9
+	#elseif flash
 	var b : flash.utils.ByteArray;
 	var b : flash.utils.ByteArray;
 	#elseif php
 	#elseif php
 	var b : String;
 	var b : String;
@@ -45,7 +45,7 @@ class BytesBuffer {
 	public function new() {
 	public function new() {
 		#if neko
 		#if neko
 		b = untyped StringBuf.__make();
 		b = untyped StringBuf.__make();
-		#elseif flash9
+		#elseif flash
 		b = new flash.utils.ByteArray();
 		b = new flash.utils.ByteArray();
 		b.endian = flash.utils.Endian.LITTLE_ENDIAN;
 		b.endian = flash.utils.Endian.LITTLE_ENDIAN;
 		#elseif php
 		#elseif php
@@ -76,7 +76,7 @@ class BytesBuffer {
 	public inline function addByte( byte : Int ) {
 	public inline function addByte( byte : Int ) {
 		#if neko
 		#if neko
 		untyped StringBuf.__add_char(b,byte);
 		untyped StringBuf.__add_char(b,byte);
-		#elseif flash9
+		#elseif flash
 		b.writeByte(byte);
 		b.writeByte(byte);
 		#elseif php
 		#elseif php
 		b += untyped __call__("chr", byte);
 		b += untyped __call__("chr", byte);
@@ -94,7 +94,7 @@ class BytesBuffer {
 	public inline function add( src : Bytes ) {
 	public inline function add( src : Bytes ) {
 		#if neko
 		#if neko
 		untyped StringBuf.__add(b,src.getData());
 		untyped StringBuf.__add(b,src.getData());
-		#elseif flash9
+		#elseif flash
 		b.writeBytes(src.getData());
 		b.writeBytes(src.getData());
 		#elseif php
 		#elseif php
 		b += cast src.getData();
 		b += cast src.getData();
@@ -118,15 +118,15 @@ class BytesBuffer {
 	public inline function addString( v : String ) {
 	public inline function addString( v : String ) {
 		#if neko
 		#if neko
 		untyped StringBuf.__add(b, v.__s);
 		untyped StringBuf.__add(b, v.__s);
-		#elseif flash9
+		#elseif flash
 		b.writeUTFBytes(v);
 		b.writeUTFBytes(v);
 		#else
 		#else
 		add(Bytes.ofString(v));
 		add(Bytes.ofString(v));
 		#end
 		#end
 	}
 	}
 
 
-	public #if flash9 inline #end function addInt32( v : Int ) {
-		#if flash9
+	public #if flash inline #end function addInt32( v : Int ) {
+		#if flash
 		b.writeUnsignedInt(v);
 		b.writeUnsignedInt(v);
 		#else
 		#else
 		addByte(v&0xFF);
 		addByte(v&0xFF);
@@ -136,13 +136,13 @@ class BytesBuffer {
 		#end
 		#end
 	}
 	}
 
 
-	public #if flash9 inline #end function addInt64( v : haxe.Int64 ) {
+	public #if flash inline #end function addInt64( v : haxe.Int64 ) {
 		addInt32(v.low);
 		addInt32(v.low);
 		addInt32(v.high);
 		addInt32(v.high);
 	}
 	}
 
 
 	public inline function addFloat( v : Float ) {
 	public inline function addFloat( v : Float ) {
-		#if flash9
+		#if flash
 		b.writeFloat(v);
 		b.writeFloat(v);
 		#else
 		#else
 		addInt32(FPHelper.floatToI32(v));
 		addInt32(FPHelper.floatToI32(v));
@@ -150,7 +150,7 @@ class BytesBuffer {
 	}
 	}
 
 
 	public inline function addDouble( v : Float ) {
 	public inline function addDouble( v : Float ) {
-		#if flash9
+		#if flash
 		b.writeDouble(v);
 		b.writeDouble(v);
 		#else
 		#else
 		addInt64(FPHelper.doubleToI64(v));
 		addInt64(FPHelper.doubleToI64(v));
@@ -163,7 +163,7 @@ class BytesBuffer {
 		#end
 		#end
 		#if neko
 		#if neko
 		try untyped StringBuf.__add_sub(b,src.getData(),pos,len) catch( e : Dynamic ) throw Error.OutsideBounds;
 		try untyped StringBuf.__add_sub(b,src.getData(),pos,len) catch( e : Dynamic ) throw Error.OutsideBounds;
-		#elseif flash9
+		#elseif flash
 		if( len > 0 ) b.writeBytes(src.getData(),pos,len);
 		if( len > 0 ) b.writeBytes(src.getData(),pos,len);
 		#elseif php
 		#elseif php
 		b += untyped __call__("substr", src.b, pos, len);
 		b += untyped __call__("substr", src.b, pos, len);
@@ -192,7 +192,7 @@ class BytesBuffer {
 		#if neko
 		#if neko
 		var str = StringBuf.__to_string(b);
 		var str = StringBuf.__to_string(b);
 		var bytes = new Bytes(__dollar__ssize(str),str);
 		var bytes = new Bytes(__dollar__ssize(str),str);
-		#elseif flash9
+		#elseif flash
 		var bytes = new Bytes(b.length,b);
 		var bytes = new Bytes(b.length,b);
 		b.position = 0;
 		b.position = 0;
 		#elseif php
 		#elseif php

+ 1 - 1
std/haxe/io/BytesData.hx

@@ -23,7 +23,7 @@ package haxe.io;
 
 
 #if neko
 #if neko
 	typedef BytesData =	neko.NativeString;
 	typedef BytesData =	neko.NativeString;
-#elseif flash9
+#elseif flash
 	typedef BytesData =	flash.utils.ByteArray;
 	typedef BytesData =	flash.utils.ByteArray;
 #elseif php
 #elseif php
 	typedef BytesData =	php.NativeString;
 	typedef BytesData =	php.NativeString;

+ 8 - 8
std/haxe/io/BytesInput.hx

@@ -23,7 +23,7 @@ package haxe.io;
 
 
 class BytesInput extends Input {
 class BytesInput extends Input {
 	var b : #if js js.html.Uint8Array #else BytesData #end;
 	var b : #if js js.html.Uint8Array #else BytesData #end;
-	#if !flash9
+	#if !flash
 	var pos : Int;
 	var pos : Int;
 	var len : Int;
 	var len : Int;
 	var totlen : Int;
 	var totlen : Int;
@@ -39,7 +39,7 @@ class BytesInput extends Input {
 		if( pos == null ) pos = 0;
 		if( pos == null ) pos = 0;
 		if( len == null ) len = b.length - pos;
 		if( len == null ) len = b.length - pos;
 		if( pos < 0 || len < 0 || pos + len > b.length ) throw Error.OutsideBounds;
 		if( pos < 0 || len < 0 || pos + len > b.length ) throw Error.OutsideBounds;
-		#if flash9
+		#if flash
 		var ba = b.getData();
 		var ba = b.getData();
 		ba.position = pos;
 		ba.position = pos;
 		if( len != ba.bytesAvailable ) {
 		if( len != ba.bytesAvailable ) {
@@ -61,7 +61,7 @@ class BytesInput extends Input {
 	}
 	}
 
 
 	inline function get_position() : Int {
 	inline function get_position() : Int {
-		#if flash9
+		#if flash
 		return b.position;
 		return b.position;
 		#else
 		#else
 		return pos;
 		return pos;
@@ -69,7 +69,7 @@ class BytesInput extends Input {
 	}
 	}
 
 
 	inline function get_length() : Int {
 	inline function get_length() : Int {
-		#if flash9
+		#if flash
 		return b.length;
 		return b.length;
 		#else
 		#else
 		return totlen;
 		return totlen;
@@ -79,7 +79,7 @@ class BytesInput extends Input {
 	function set_position( p : Int ) : Int {
 	function set_position( p : Int ) : Int {
 		if( p < 0 ) p = 0;
 		if( p < 0 ) p = 0;
 		else if( p > length ) p = length;
 		else if( p > length ) p = length;
-		#if flash9
+		#if flash
 		return b.position = p;
 		return b.position = p;
 		#else
 		#else
 		len = totlen - p;
 		len = totlen - p;
@@ -88,7 +88,7 @@ class BytesInput extends Input {
 	}
 	}
 
 
 	public override function readByte() : Int {
 	public override function readByte() : Int {
-		#if flash9
+		#if flash
 			return try b.readUnsignedByte() catch( e : Dynamic ) throw new Eof();
 			return try b.readUnsignedByte() catch( e : Dynamic ) throw new Eof();
 		#else
 		#else
 			if( this.len == 0 )
 			if( this.len == 0 )
@@ -113,7 +113,7 @@ class BytesInput extends Input {
 			if( pos < 0 || len < 0 || pos + len > buf.length )
 			if( pos < 0 || len < 0 || pos + len > buf.length )
 				throw Error.OutsideBounds;
 				throw Error.OutsideBounds;
 		#end
 		#end
-		#if flash9
+		#if flash
 			var avail : Int = b.bytesAvailable;
 			var avail : Int = b.bytesAvailable;
 			if( len > avail && avail > 0 ) len = avail;
 			if( len > avail && avail > 0 ) len = avail;
 			try b.readBytes(buf.getData(),pos,len) catch( e : Dynamic ) throw new Eof();
 			try b.readBytes(buf.getData(),pos,len) catch( e : Dynamic ) throw new Eof();
@@ -154,7 +154,7 @@ class BytesInput extends Input {
 		return len;
 		return len;
 	}
 	}
 
 
-	#if flash9
+	#if flash
 	@:dox(hide)
 	@:dox(hide)
 	override function set_bigEndian(e) {
 	override function set_bigEndian(e) {
 		bigEndian = e;
 		bigEndian = e;

+ 6 - 6
std/haxe/io/BytesOutput.hx

@@ -23,7 +23,7 @@ package haxe.io;
 
 
 class BytesOutput extends Output {
 class BytesOutput extends Output {
 
 
-	#if flash9
+	#if flash
 	var b : flash.utils.ByteArray;
 	var b : flash.utils.ByteArray;
 	#else
 	#else
 	var b : BytesBuffer;
 	var b : BytesBuffer;
@@ -33,7 +33,7 @@ class BytesOutput extends Output {
 	public var length(get,never) : Int;
 	public var length(get,never) : Int;
 
 
 	public function new() {
 	public function new() {
-		#if flash9
+		#if flash
 		b = new flash.utils.ByteArray();
 		b = new flash.utils.ByteArray();
 		b.endian = flash.utils.Endian.LITTLE_ENDIAN;
 		b.endian = flash.utils.Endian.LITTLE_ENDIAN;
 		#else
 		#else
@@ -49,7 +49,7 @@ class BytesOutput extends Output {
 	}
 	}
 
 
 	override function writeByte(c) {
 	override function writeByte(c) {
-		#if flash9
+		#if flash
 		b.writeByte(c);
 		b.writeByte(c);
 		#else
 		#else
 		b.addByte(c);
 		b.addByte(c);
@@ -57,7 +57,7 @@ class BytesOutput extends Output {
 	}
 	}
 
 
 	override function writeBytes( buf : Bytes, pos, len ) : Int {
 	override function writeBytes( buf : Bytes, pos, len ) : Int {
-		#if flash9
+		#if flash
 		if( pos < 0 || len < 0 || pos + len > buf.length ) throw Error.OutsideBounds;
 		if( pos < 0 || len < 0 || pos + len > buf.length ) throw Error.OutsideBounds;
 		b.writeBytes(buf.getData(),pos,len);
 		b.writeBytes(buf.getData(),pos,len);
 		#else
 		#else
@@ -66,7 +66,7 @@ class BytesOutput extends Output {
 		return len;
 		return len;
 	}
 	}
 
 
-	#if flash9
+	#if flash
 	// optimized operations
 	// optimized operations
 
 
 	@:dox(hide)
 	@:dox(hide)
@@ -123,7 +123,7 @@ class BytesOutput extends Output {
 	#end
 	#end
 
 
 	public function getBytes() : Bytes {
 	public function getBytes() : Bytes {
-		#if flash9
+		#if flash
 		var bytes = b;
 		var bytes = b;
 		b = null;
 		b = null;
 		return untyped new Bytes(bytes.length,bytes);
 		return untyped new Bytes(bytes.length,bytes);

+ 5 - 5
std/haxe/io/FPHelper.hx

@@ -46,7 +46,7 @@ class FPHelper {
 		static var _float_bytes = neko.Lib.load("std","float_bytes",2);
 		static var _float_bytes = neko.Lib.load("std","float_bytes",2);
 		static var _double_bytes = neko.Lib.load("std","double_bytes",2);
 		static var _double_bytes = neko.Lib.load("std","double_bytes",2);
 		#end
 		#end
-	#elseif flash9
+	#elseif flash
 		static var helper = {
 		static var helper = {
 			var b = new flash.utils.ByteArray();
 			var b = new flash.utils.ByteArray();
 			b.endian = flash.utils.Endian.LITTLE_ENDIAN;
 			b.endian = flash.utils.Endian.LITTLE_ENDIAN;
@@ -89,7 +89,7 @@ class FPHelper {
 			return java.lang.Float.FloatClass.intBitsToFloat(i);
 			return java.lang.Float.FloatClass.intBitsToFloat(i);
 		#elseif php
 		#elseif php
 			return untyped  __call__('unpack', 'f', __call__('pack', 'l', i))[1];
 			return untyped  __call__('unpack', 'f', __call__('pack', 'l', i))[1];
-		#elseif flash9
+		#elseif flash
 			var helper = helper;
 			var helper = helper;
 			helper.position = 0;
 			helper.position = 0;
 			helper.writeUnsignedInt(i);
 			helper.writeUnsignedInt(i);
@@ -127,7 +127,7 @@ class FPHelper {
 			}
 			}
 		#elseif java
 		#elseif java
 			return java.lang.Float.FloatClass.floatToRawIntBits(f);
 			return java.lang.Float.FloatClass.floatToRawIntBits(f);
-		#elseif flash9
+		#elseif flash
 			var helper = helper;
 			var helper = helper;
 			helper.position = 0;
 			helper.position = 0;
 			helper.writeFloat(f);
 			helper.writeFloat(f);
@@ -181,7 +181,7 @@ class FPHelper {
 			return helper.f;
 			return helper.f;
 		#elseif java
 		#elseif java
 			return java.lang.Double.DoubleClass.longBitsToDouble( Int64.make(high,low) );
 			return java.lang.Double.DoubleClass.longBitsToDouble( Int64.make(high,low) );
-		#elseif flash9
+		#elseif flash
 			var helper = helper;
 			var helper = helper;
 			helper.position = 0;
 			helper.position = 0;
 			helper.writeUnsignedInt(low);
 			helper.writeUnsignedInt(low);
@@ -250,7 +250,7 @@ class FPHelper {
 
 
 				return haxe.Int64.make(j1,j2);
 				return haxe.Int64.make(j1,j2);
 			}
 			}
-		#elseif flash9
+		#elseif flash
 			var helper = helper;
 			var helper = helper;
 			helper.position = 0;
 			helper.position = 0;
 			helper.writeDouble(v);
 			helper.writeDouble(v);

+ 0 - 3
std/haxe/io/Path.hx

@@ -225,10 +225,8 @@ class Path {
 		}
 		}
 
 
 		var tmp = target.join(slash);
 		var tmp = target.join(slash);
-		#if !flash8
 		var regex = ~/([^:])\/+/g;
 		var regex = ~/([^:])\/+/g;
 		var result = regex.replace(tmp, "$1" +slash);
 		var result = regex.replace(tmp, "$1" +slash);
-		#else
 		var acc = new StringBuf();
 		var acc = new StringBuf();
 		var colon = false;
 		var colon = false;
 		var slashes = false;
 		var slashes = false;
@@ -249,7 +247,6 @@ class Path {
 			}
 			}
 		}
 		}
 		var result = acc.toString();
 		var result = acc.toString();
-		#end
 		return result;
 		return result;
 	}
 	}
 
 

+ 2 - 14
std/haxe/remoting/AMFConnection.hx

@@ -25,10 +25,8 @@ class AMFConnection implements AsyncConnection implements Dynamic<AsyncConnectio
 
 
 	var __data : {
 	var __data : {
 		error : Dynamic -> Void,
 		error : Dynamic -> Void,
-		#if flash9
+		#if flash
 		cnx : flash.net.NetConnection,
 		cnx : flash.net.NetConnection,
-		#elseif flash
-		cnx : flash.NetConnection,
 		#else
 		#else
 		cnx : Dynamic,
 		cnx : Dynamic,
 		#end
 		#end
@@ -57,7 +55,7 @@ class AMFConnection implements AsyncConnection implements Dynamic<AsyncConnectio
 	public function call( params : Array<Dynamic>, ?onResult : Dynamic -> Void ) : Void {
 	public function call( params : Array<Dynamic>, ?onResult : Dynamic -> Void ) : Void {
 		if( onResult == null ) onResult = function(e) {};
 		if( onResult == null ) onResult = function(e) {};
 		var p = params.copy();
 		var p = params.copy();
-		#if flash9
+		#if flash
 		p.unshift(new flash.net.Responder(onResult,__data.error));
 		p.unshift(new flash.net.Responder(onResult,__data.error));
 		#else
 		#else
 		p.unshift({ onStatus : __data.error, onResult : onResult });
 		p.unshift({ onStatus : __data.error, onResult : onResult });
@@ -68,7 +66,6 @@ class AMFConnection implements AsyncConnection implements Dynamic<AsyncConnectio
 
 
 	#if flash
 	#if flash
 	public static function urlConnect( gatewayUrl : String ) {
 	public static function urlConnect( gatewayUrl : String ) {
-		#if flash9
 		var c = new flash.net.NetConnection();
 		var c = new flash.net.NetConnection();
 		var cnx = new AMFConnection({ cnx : c, error : function(e) throw e },[]);
 		var cnx = new AMFConnection({ cnx : c, error : function(e) throw e },[]);
 		c.addEventListener(flash.events.NetStatusEvent.NET_STATUS,function(e:flash.events.NetStatusEvent) {
 		c.addEventListener(flash.events.NetStatusEvent.NET_STATUS,function(e:flash.events.NetStatusEvent) {
@@ -76,24 +73,15 @@ class AMFConnection implements AsyncConnection implements Dynamic<AsyncConnectio
 		});
 		});
 		c.connect(gatewayUrl);
 		c.connect(gatewayUrl);
 		return cnx;
 		return cnx;
-		#else
-		var c = new flash.NetConnection();
-		if( !c.connect(gatewayUrl) )
-			throw "Could not connected to gateway url "+gatewayUrl;
-		return new AMFConnection({ cnx : c, error : function(e) throw e },[]);
-		#end
 	}
 	}
 
 
 	public static function connect( nc ) {
 	public static function connect( nc ) {
 		return new AMFConnection({ cnx : nc, error : function(e) throw e },[]);
 		return new AMFConnection({ cnx : nc, error : function(e) throw e },[]);
 	}
 	}
 
 
-	#if flash9
 	public static function registerClassAlias( s : String, cl : Class<Dynamic> ) {
 	public static function registerClassAlias( s : String, cl : Class<Dynamic> ) {
 		untyped __global__[ "flash.net.registerClassAlias" ]( s, cl );
 		untyped __global__[ "flash.net.registerClassAlias" ]( s, cl );
 	}
 	}
 	#end
 	#end
 
 
-	#end
-
 }
 }

+ 1 - 9
std/haxe/remoting/ExternalConnection.hx

@@ -45,14 +45,10 @@ class ExternalConnection implements Connection implements Dynamic<Connection> {
 		connections.remove(__data.name);
 		connections.remove(__data.name);
 	}
 	}
 
 
-	#if flash9
+	#if flash
 	static function escapeString( s : String ) {
 	static function escapeString( s : String ) {
 		return s.split("\\").join("\\\\");
 		return s.split("\\").join("\\\\");
 	}
 	}
-	#elseif flash
-	static function escapeString( s : String ) {
-		return s.split("\\").join("\\\\").split("&").join("&amp;");
-	}
 	#else
 	#else
 	static inline function escapeString(s) {
 	static inline function escapeString(s) {
 		return s;
 		return s;
@@ -123,11 +119,7 @@ class ExternalConnection implements Connection implements Dynamic<Connection> {
 	public static function jsConnect( name : String, ?ctx : Context ) {
 	public static function jsConnect( name : String, ?ctx : Context ) {
 		if( !flash.external.ExternalInterface.available )
 		if( !flash.external.ExternalInterface.available )
 			throw "External Interface not available";
 			throw "External Interface not available";
-		#if flash9
 		try flash.external.ExternalInterface.addCallback("externalRemotingCall",doCall) catch( e : Dynamic ) {};
 		try flash.external.ExternalInterface.addCallback("externalRemotingCall",doCall) catch( e : Dynamic ) {};
-		#else
-		flash.external.ExternalInterface.addCallback("externalRemotingCall",null,doCall);
-		#end
 		var cnx = new ExternalConnection({ name : name, ctx : ctx },[]);
 		var cnx = new ExternalConnection({ name : name, ctx : ctx },[]);
 		connections.set(name,cnx);
 		connections.set(name,cnx);
 		return cnx;
 		return cnx;

+ 1 - 5
std/haxe/remoting/FlashJsConnection.hx

@@ -90,7 +90,7 @@ class FlashJsConnection #if flash implements AsyncConnection implements Dynamic<
 	static var connections = new haxe.ds.StringMap<FlashJsConnection>();
 	static var connections = new haxe.ds.StringMap<FlashJsConnection>();
 
 
 	static function escapeString( s : String ) {
 	static function escapeString( s : String ) {
-		#if flash9
+		#if flash
 		return s.split("\\").join("\\\\");
 		return s.split("\\").join("\\\\");
 		#else
 		#else
 		return s.split("\\").join("\\\\").split("&").join("&amp;");
 		return s.split("\\").join("\\\\").split("&").join("&amp;");
@@ -120,11 +120,7 @@ class FlashJsConnection #if flash implements AsyncConnection implements Dynamic<
 	public static function connect( name : String, objId : String, ?ctx : Context ) {
 	public static function connect( name : String, objId : String, ?ctx : Context ) {
 		if( !flash.external.ExternalInterface.available )
 		if( !flash.external.ExternalInterface.available )
 			throw "External Interface not available";
 			throw "External Interface not available";
-		#if flash9
 		try flash.external.ExternalInterface.addCallback("flashJsRemotingCall",doCall) catch( e : Dynamic ) {};
 		try flash.external.ExternalInterface.addCallback("flashJsRemotingCall",doCall) catch( e : Dynamic ) {};
-		#else
-		flash.external.ExternalInterface.addCallback("flashJsRemotingCall",null,doCall);
-		#end
 		var cnx = new FlashJsConnection({
 		var cnx = new FlashJsConnection({
 			id : objId,
 			id : objId,
 			name : name,
 			name : name,

+ 20 - 47
std/haxe/remoting/LocalConnection.hx

@@ -31,10 +31,8 @@ class LocalConnection implements AsyncConnection implements Dynamic<AsyncConnect
 		results : haxe.ds.IntMap<{ error : Dynamic -> Void, result : Dynamic -> Void }>,
 		results : haxe.ds.IntMap<{ error : Dynamic -> Void, result : Dynamic -> Void }>,
 		error : Dynamic -> Void,
 		error : Dynamic -> Void,
 		target : String,
 		target : String,
-		#if flash9
+		#if flash
 		cnx : flash.net.LocalConnection,
 		cnx : flash.net.LocalConnection,
-		#elseif flash
-		cnx : flash.LocalConnection,
 		#else
 		#else
 		cnx : Dynamic,
 		cnx : Dynamic,
 		#end
 		#end
@@ -58,7 +56,7 @@ class LocalConnection implements AsyncConnection implements Dynamic<AsyncConnect
 	public function call( params : Array<Dynamic>, ?onResult : Dynamic -> Void ) : Void {
 	public function call( params : Array<Dynamic>, ?onResult : Dynamic -> Void ) : Void {
 		try {
 		try {
 			var id = ID++;
 			var id = ID++;
-			#if flash9
+			#if flash
 			__data.cnx.send(__data.target,"remotingCall",id,__path.join("."),haxe.Serializer.run(params));
 			__data.cnx.send(__data.target,"remotingCall",id,__path.join("."),haxe.Serializer.run(params));
 			#else
 			#else
 			if( !__data.cnx.send(__data.target,"remotingCall",id,__path.join("."),haxe.Serializer.run(params)) )
 			if( !__data.cnx.send(__data.target,"remotingCall",id,__path.join("."),haxe.Serializer.run(params)) )
@@ -107,11 +105,7 @@ class LocalConnection implements AsyncConnection implements Dynamic<AsyncConnect
 
 
 	#if flash
 	#if flash
 	public static function connect( name : String, ?ctx : Context, ?allowDomains : Array<String> ) {
 	public static function connect( name : String, ?ctx : Context, ?allowDomains : Array<String> ) {
-		#if flash9
-			var l = new flash.net.LocalConnection();
-		#else
-			var l = new flash.LocalConnection();
-		#end
+		var l = new flash.net.LocalConnection();
 		var recv = name + "_recv";
 		var recv = name + "_recv";
 		var c = new LocalConnection({
 		var c = new LocalConnection({
 			ctx : ctx,
 			ctx : ctx,
@@ -120,44 +114,23 @@ class LocalConnection implements AsyncConnection implements Dynamic<AsyncConnect
 			cnx : l,
 			cnx : l,
 			target : recv,
 			target : recv,
 		},[]);
 		},[]);
-		#if flash9
-			l.client = {
-				remotingCall : remotingCall.bind(c),
-				remotingResult : remotingResult.bind(c),
-			};
-			l.addEventListener(flash.events.StatusEvent.STATUS, function(s:flash.events.StatusEvent) {
-				if( s.level != "status" )
-					c.__data.error("Failed to send data on LocalConnection");
-			});
-			try
-				l.connect(name)
-			catch( e : Dynamic ) {
-				l.connect(recv);
-				c.__data.target = name;
-			}
-			if( allowDomains != null )
-				for( d in allowDomains )
-					l.allowDomain(d);
-		#else
-			Reflect.setField(l,"remotingCall",remotingCall.bind(c));
-			Reflect.setField(l,"remotingResult",remotingResult.bind(c));
-			l.onStatus = function(s:Dynamic) {
-				if( s[untyped "level"] != "status" )
-					c.__data.error("Failed to send data on LocalConnection");
-			};
-			if( !l.connect(name) ) {
-				if( !l.connect(recv) )
-					throw "Could not assign a LocalConnection to the name "+name;
-				c.__data.target = name;
-			}
-			if( allowDomains != null )
-				l.allowDomain = function(dom) {
-					for( d in allowDomains )
-						if( d == dom )
-							return true;
-					return false;
-				};
-		#end
+		l.client = {
+			remotingCall : remotingCall.bind(c),
+			remotingResult : remotingResult.bind(c),
+		};
+		l.addEventListener(flash.events.StatusEvent.STATUS, function(s:flash.events.StatusEvent) {
+			if( s.level != "status" )
+				c.__data.error("Failed to send data on LocalConnection");
+		});
+		try
+			l.connect(name)
+		catch( e : Dynamic ) {
+			l.connect(recv);
+			c.__data.target = name;
+		}
+		if( allowDomains != null )
+			for( d in allowDomains )
+				l.allowDomain(d);
 		return c;
 		return c;
 	}
 	}
 	#end
 	#end

+ 4 - 8
std/haxe/remoting/SocketConnection.hx

@@ -30,12 +30,10 @@ class SocketConnection implements AsyncConnection implements Dynamic<AsyncConnec
 		results : List<{ onResult : Dynamic -> Void, onError : Dynamic -> Void }>,
 		results : List<{ onResult : Dynamic -> Void, onError : Dynamic -> Void }>,
 		log : Array<String> -> Array<Dynamic> -> Dynamic -> Void,
 		log : Array<String> -> Array<Dynamic> -> Dynamic -> Void,
 		error : Dynamic -> Void,
 		error : Dynamic -> Void,
-		#if !flash9
-		#if (flash || js)
+		#if js
 		queue : Array<Void -> Void>,
 		queue : Array<Void -> Void>,
 		timer : haxe.Timer,
 		timer : haxe.Timer,
 		#end
 		#end
-		#end
 	};
 	};
 
 
 	function new(data,path) {
 	function new(data,path) {
@@ -125,16 +123,14 @@ class SocketConnection implements AsyncConnection implements Dynamic<AsyncConnec
 			results : new List(),
 			results : new List(),
 			error : function(e) throw e,
 			error : function(e) throw e,
 			log : null,
 			log : null,
-			#if !flash9
-			#if (flash || js)
+			#if js
 			queue : [],
 			queue : [],
 			timer : null,
 			timer : null,
 			#end
 			#end
-			#end
 		};
 		};
 		var sc = new SocketConnection(data,[]);
 		var sc = new SocketConnection(data,[]);
 		data.log = sc.defaultLog;
 		data.log = sc.defaultLog;
-		#if flash9
+		#if flash
 		s.addEventListener(flash.events.DataEvent.DATA, function(e : flash.events.DataEvent) {
 		s.addEventListener(flash.events.DataEvent.DATA, function(e : flash.events.DataEvent) {
 			var data = e.data;
 			var data = e.data;
 			var msgLen = sc.__data.protocol.messageLength(data.charCodeAt(0),data.charCodeAt(1));
 			var msgLen = sc.__data.protocol.messageLength(data.charCodeAt(0),data.charCodeAt(1));
@@ -144,7 +140,7 @@ class SocketConnection implements AsyncConnection implements Dynamic<AsyncConnec
 			}
 			}
 			sc.processMessage(e.data.substr(2,e.data.length-2));
 			sc.processMessage(e.data.substr(2,e.data.length-2));
 		});
 		});
-		#elseif (flash || js)
+		#elseif js
 		// we can't deliver directly the message
 		// we can't deliver directly the message
 		// since it might trigger a blocking action on JS side
 		// since it might trigger a blocking action on JS side
 		// and in that case this will trigger a Flash bug
 		// and in that case this will trigger a Flash bug

+ 1 - 3
std/haxe/remoting/SocketProtocol.hx

@@ -22,10 +22,8 @@
 package haxe.remoting;
 package haxe.remoting;
 
 
 typedef Socket =
 typedef Socket =
-	#if flash9
+	#if flash
 		flash.net.XMLSocket
 		flash.net.XMLSocket
-	#elseif flash
-		flash.XMLSocket
 	#elseif js
 	#elseif js
 		js.XMLSocket
 		js.XMLSocket
 	#elseif sys
 	#elseif sys

Some files were not shown because too many files changed in this diff