0

On my local Tomcat 8 I added crossdomain.xml as explained here:

Where do I put a crossdomain XML in Tomcat?

I did the check and I can see

http://localhost:8080/crossdomain.xml

from the browser.

But when I try to send a request from an swf in one of the web projects, it looks like it tries to find

http://localhost/crossdomain.xml

How do I tell Flash to search the file in the 8080 port?

Community
  • 1
  • 1
rapt
  • 11,810
  • 35
  • 103
  • 145

1 Answers1

0

Try using:

Security.loadPolicyFile("http://localhost:8080/crossdomain.xml");

Also try to allow ports in crossdomain.xml itself

<allow-access-from domain="*" to-ports="*"/> 
gMirian
  • 651
  • 7
  • 13
  • The first line: use where exactly...? Second line: already have it. Seems like the swf cannot find the file at this point, so how would it matter what I have there? If I understand how this security thing works, on the server side I am not supposed to do more than putting it in the domain root. – rapt May 15 '17 at 06:38
  • 2
    You need to add this first line right at the beginning of your flash project (as AS3 code). More on that here http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/Security.html#loadPolicyFile() . But normally you don't need a crossdomain on a localhost, it is only needed if you want to load something from another domain – Philarmon May 15 '17 at 12:49
  • @Philarmon Thanks. This was an `fla` that I did not originally create, but downloaded from the web. I had to change one of its associated `as` files, to point to my `localhost:8080` instead of some external domain. Then like you said I did not need `crossdomain.xml`. – rapt May 16 '17 at 02:56