flash 表单提交

 import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; import flash.net.URLRequest; import flash.net.URLRequestMethod; import flash.events.ProgressEvent; import flash.text.TextField;//新建记事本 import flash.net.URLVariables; //----------------------URLRequest-------------------- var send_urlrequest:URLRequest =new URLRequest(); send_urlrequest.url="http://localhost/write.php"; send_urlrequest.method=URLRequestMethod.POST; //----------------------Data载体--------------------- var data_urlvariables:URLVariables=new URLVariables ; data_urlvariables["a"]=26; data_urlvariables["b"]=100; send_urlrequest.data=data_urlvariables; //-----------------------XML------------------------ var load_xml:XML; //----------------------URLLoader-------------------- var handler_loader:URLLoader=new URLLoader ; handler_loader.addEventListener(Event.COMPLETE ,onLoadCompleteHandler); function onLoadCompleteHandler(_evt:Event):void { trace(_evt.target.data); //load_xml=XML(_evt.target.data); //show_txt.text=load_xml; show_txt.appendText("其中返回的得数是:"); } try { handler_loader.load(send_urlrequest); } catch (_err:Error) { trace(_err); } //--------------------创建一个用于显示的TextField---------------- // var show_txt:TextField =new TextField; show_txt.multiline =show_txt.wordWrap =true; show_txt.width =show_txt.height =400; show_txt.x=75; addChild(show_txt); //

你可能感兴趣的:(xml,function,Flash,import)