[Reprint] Resolve Flash and JS interaction, flash Cross-domain interaction, flash cross-domain submission

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.