To create a prompt function for short messages on the page, I originally wanted to use bgsound under Audio+IE in HTML5, but I found that each browser has different decoding types for Audio, and I suddenly felt like I was crashing. There is no way to use Flash to be safer.
I believe that everyone will have some contact or hear about JavaScript and Flash interactions. Actually, it's the first time I've been doing this thing. I won’t talk about the specific methods, a lot of information.
At the beginning, the functions were almost done, and the implementation was no problem. But at the end, when the swf file was placed on the resource service and then called, I thought it was definitely another painful cross-domain problem (CrossDomain). Later, after searching online for a long time, I finally got the problem done.
First of all, to make your Flash accessible to the page, you need to add the allowscriptaccess=always section to the <embed> tag.
Secondly, if you want JavaScript in your page to access Flash, you need to add the following content to your Flash script:
The code copy is as follows:
import flash.system.Security;
Security.allowDomain('www.VeVB.COM');
Among them, www.VeVB.COM needs to be replaced with the domain of your own page. If you are not very clear, you can use alert (document.domain) to view it. If you need multiple domains to access this Flash, you can add multiple allowDomain records.