Browse Source

fix for flash<8

Nicolas Cannasse 18 năm trước cách đây
mục cha
commit
9f28fe2949

+ 1 - 0
doc/CHANGES.txt

@@ -1,5 +1,6 @@
 2007-??-??: 1.16
 	use _sans font for default flash traces (better Linux support)
+	fixed haxe.remoting.Connection compilation for Flash<8
 
 2007-08-29: 1.15
 	fixed bug with Enum.construct when Enum have type parameters

+ 0 - 4
std/flash/external/ExternalInterface.hx

@@ -1,9 +1,5 @@
 package flash.external;
 
-#if !flash8
-"This class is only accesible in Flash8"
-#end
-
 extern class ExternalInterface {
 
 	static var available : Bool;

+ 6 - 4
std/haxe/remoting/Connection.hx

@@ -59,11 +59,13 @@ class Connection implements Dynamic<Connection> {
 		s.serialize(params);
 		var params = escapeString(s.toString());
 		#if (flash8 || flash9)
-		var s = flash.external.ExternalInterface.call("haxe.remoting.Connection.doCall",path,f,params);
-		if( s == null )
+			var s = flash.external.ExternalInterface.call("haxe.remoting.Connection.doCall",path,f,params);
+			if( s == null )
+				throw "Failed to call JS method "+__path.join(".");
+			return new haxe.Unserializer(s).unserialize();
+		#else true
+			throw "JS method call is not supported on Flash < 8";
 		#end
-			throw "Failed to call JS method "+__path.join(".");
-		return new haxe.Unserializer(s).unserialize();
 	#else js
 		var p = __path.copy();
 		var f = p.pop();