http://blog.csdn.net/andyxm/article/details/5219919
We refer to local flash for Flash and JS bidirectional interaction.
function Thismovie (moviename) {
if (Window.document[moviename]) {
return Window.document[moviename];
}else if (navigator.appName.indexOf ("Microsoft") ==-1) {
if (document.embeds && document.embeds[moviename])
return Document.embeds[moviename];
}else{
return document.getElementById (Moviename);
}
}
Flash cannot be accessed across domain HTTP when data is submitted. So the flash resources placed under the server, the next problem is that Flash and JS is not a domain, and there is an interactive cross-domain problem. The solution is to put the original
<embed>
<param name= "allowscriptaccess" value= "Samedomain"/>
<embed src= "" allowscriptaccess= "Samedomain"/>
Changed to cross-domain access
<embed>
<param name= "allowscriptaccess" value= "Always"/>
<embed src= "" allowscriptaccess= "Always"/>
So if we use a browser to access http://example1.com/index.php This page, in this page reference http://example2.com/flash.swf this Flash file, and then in the Flash code to the HTTP ://example3.com/webservice.php sends an HTTP request.
You will need to add crossdomain.xml to the Example3 to allow example2 access.
<cross-domain-policy>
<allow-access-from domain= "example2.com"/>
</cross-domain-policy>