My Flash project downloads data from the Internet through a PHP page on my website. It works properly in the following environments, but it won't work when I try to test it with a local HTML file that contains the SWF.
My SWF can connect to the Internet in:
Adobe Animate Test (Ctrl+Enter)
Adobe Animate Debug (Ctrl+Shift+Enter)
Standalone Flash Player
On my website in HTML (www.myWebsite.com/myFlash.html)
My SWF CANNOT connect to the Internet in:
local HTML file containing the SWF (C:\test\myFlash.html)
Is it possible to use a local HTML with embedded SWF to connect to the Internet? I've been trying to get it to work in Chrome, MS Edge, and IE11, but I have been unsuccessful.
Here is my HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body style="background-color:#f0f5f8">
<object width="1280" height="720" data="Main.swf" style="border:1px solid black; margin-left: auto; margin-right:auto; display:block">
<param name="movie" value="Main.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<param name="play" value="true" />
<param name="loop" value="false" />
<param name="wmode" value="direct" />
<param name="scale" value="showall" />
<param name="menu" value="false" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreenInteractive" value="true" />
</object>
</body>
</html>
Edit: I made my SWF output the error message, and now when I try to play it in a local HTML, a TextField displays "securityError - Error #2048". That seems to be in regard to having a crossdomain.xml on the website, which I do have at www.myWebsite.com/crossdomain.xml:
<?xml version="1.0" ?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="*" />
</cross-domain-policy>
I figured it out. I had to change this line in my crossdomain.xml from this:
<allow-access-from domain="*"/>
to this:
<allow-access-from domain="*" secure="false"/>
My site is actually https://www.myWebsite.com/, which means I needed secure="false" so that non-https sites could access it.