Browse Source

added flash.XmlRequest

Nicolas Cannasse 18 years ago
parent
commit
5ff00d9ec8
3 changed files with 28 additions and 0 deletions
  1. 8 0
      doc/CHANGES.txt
  2. 19 0
      std/flash/XMLRequest.hx
  3. 1 0
      std/haxe/ImportAll.hx

+ 8 - 0
doc/CHANGES.txt

@@ -11,6 +11,14 @@
 	fixed inherited constructor of extern class was always private
 	fixed Ereg.split without 'g' flag on JS/Flash9
 	fixed haxe.Stack in JS without -debug
+	added support for -D no-swf-compress
+	fixed ByteArray.readObject
+	fixed implements Dynamic in Flash9
+	removed neko.io.FileInput.eof, fixed neko.io.Input.readLine
+	fixed haxe.Template for Flash9
+	added neko.Sys.command optional array of arguments
+	removed haxe.Proxy
+	added flash.XMLRequest
 
 2007-08-29: 1.15
 	fixed bug with Enum.construct when Enum have type parameters

+ 19 - 0
std/flash/XMLRequest.hx

@@ -0,0 +1,19 @@
+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);
+	}
+
+}

+ 1 - 0
std/haxe/ImportAll.hx

@@ -299,6 +299,7 @@ import flash.TextField;
 import flash.TextFormat;
 import flash.TextSnapshot;
 import flash.Video;
+import flash.XMLRequest;
 import flash.XMLSocket;
 
 import flash.text.StyleSheet;