Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 使用post方法as2将数据从flash发送到php_Actionscript 3_Actionscript 2 - Fatal编程技术网

Actionscript 3 使用post方法as2将数据从flash发送到php

Actionscript 3 使用post方法as2将数据从flash发送到php,actionscript-3,actionscript-2,Actionscript 3,Actionscript 2,我在as3中使用以下代码: var Request:URLRequest = new URLRequest(); var xmlMain:XML=new XML(); var urlXmlLoader:Loader = new Loader(); var myVars:URLVariables = new URLVariables(); myVars.RequestXml = xmlMain; Request.url = "http://www.xyz.php"; //some php url

我在as3中使用以下代码:

var Request:URLRequest = new URLRequest();
var xmlMain:XML=new XML();
var urlXmlLoader:Loader = new Loader();
var myVars:URLVariables = new URLVariables();

myVars.RequestXml = xmlMain;
Request.url = "http://www.xyz.php"; //some php url

Request.method = URLRequestMethod.POST;
Request.data = myVars;
urlXmlLoader.dataFormat = URLLoaderDataFormat.TEXT;
urlXmlLoader.addEventListener(Event.COMPLETE, getData);
urlXmlLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
urlXmlLoader.load(Request);

现在我有一个as2项目,我需要做同样的事情。如何在as2中实现这一点?

这可能是关于as2中HTTP请求的最佳教程:

这是一个很好的例子,说明了为什么只有链接的答案没有什么价值。我完全同意这种说法。我不会再犯这个错误了。该页面可以在web存档中找到