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 指明「;请求方法";在externalinterface.call方法中?_Actionscript 3_Apache Flex_Adobe - Fatal编程技术网

Actionscript 3 指明「;请求方法";在externalinterface.call方法中?

Actionscript 3 指明「;请求方法";在externalinterface.call方法中?,actionscript-3,apache-flex,adobe,Actionscript 3,Apache Flex,Adobe,当用户尝试下载文件时,我需要打开一个新的html窗口并下载文件,目前我使用“ExternalInterface.call”,但我需要设置“requestmethod”,否则服务器会抛出错误,如何指定“requestmethod”?为什么不使用全局导航URL方法?您可以传入一个URLRequest对象,该对象具有名为method的属性,将解决您的问题 所以你需要这样的东西: var request:URLRequest = new URLRequest("http://example.com");

当用户尝试下载文件时,我需要打开一个新的html窗口并下载文件,目前我使用“ExternalInterface.call”,但我需要设置“requestmethod”,否则服务器会抛出错误,如何指定“requestmethod”?

为什么不使用全局
导航URL
方法?您可以传入一个
URLRequest
对象,该对象具有名为
method
的属性,将解决您的问题

所以你需要这样的东西:

var request:URLRequest = new URLRequest("http://example.com");
request.method = URLRequestMethod.POST; // or anything you want

// parameters can be added to a URLVariables object 
// which then can be set as requests data property
// example:

var params:URLVariables = new URLVariables();
params.username = "test";
params.password = "123";

request.data = params;

// load the page
// specify '_blank' parameter to open it in a new browser window
navigateToURL(request, "_blank");

navigateToURL与chrome 29存在一些问题。这就是我们寻找其他解决方案的原因。然后按照@Lee Burrows的建议去做。ExternalInterface.call可以调用JS函数,所以让JS函数来设置请求方法和URL我可以设置URL,如何在JavaScripts中设置请求方法超出我的专业领域