1

I have a SWF that contacts a php script all on the same domain. In the first case both are hosted behind the same domain and communicate with no problem. Everything is working great.

However when I take the same markup that embeds the SWF and paste it on another site (using a full qualified path for the swf in both the locally hosted and remotely hosted code), the SWF no longer communicates with the php script I wrote.

I added a cross domain file to my site which looks like this.

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy 
  SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>

I added this cross domain file to both the root of my hosted domain and also to the directory where the swf is being hosted. However neither have fixed the problem. Can someone tell me why my SWF isn't communicating with my PHP script and how I can get it working?

Ryan
  • 165
  • 1
  • 11

3 Answers3

1

allowScriptAccess is an embed parameter for letting the SWF use javascript in its containing DOM. so it won't affect cross domain access.

the crossdomain.xml file should be all you need to add to the webroot of the external domain that the SWF is trying to communicate with.

Can you double check that you are not getting a 404 error or some other HTTP problem when trying your crossdomain communication? are any error exceptions being thrown that can help you debug the issue.

Post a link if you can.

gthmb
  • 808
  • 5
  • 10
  • So here is the link of the outside site, that can't communicate to the PHP Script. http://ryan.d3-systems.com/?p=148 and here is the exact same script working correctly, http://securedmark.com/demo.php . You can see that I have a crossdomain.xml both here http://ryan.d3-systems.com/crossdomain.xml and here http://d3-systems.com/crossdomain.xml . So I can't figure out what the heck I'm doing wrong here since it works great on the hosted site. – Ryan Dec 06 '10 at 02:53
0

Try adding allowScriptAccess="always" parameter to your embed and object tag.

nuaavee
  • 1,336
  • 2
  • 16
  • 31
  • No luck, sorry. After adding AllowScriptAccess, nothing changes. Still works when referenced behind the hosted domain, and doesn't work on the remote domain – Ryan Nov 17 '10 at 15:23
0

Make sure that your canonical redirection is not getting in the way of the script. I noticed that you don't redirect the same in both domains and perhaps you are targeting the script with the valid prefix in both, i.e:

It might not be the same www.d3-systems.com to d3-systems.com...

goliatone
  • 2,183
  • 16
  • 29