Actionscript 3 指明「;请求方法";在externalinterface.call方法中?
当用户尝试下载文件时,我需要打开一个新的html窗口并下载文件,目前我使用“ExternalInterface.call”,但我需要设置“requestmethod”,否则服务器会抛出错误,如何指定“requestmethod”?为什么不使用全局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");
导航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中设置请求方法超出我的专业领域