views:

50

answers:

1

Hi, I'm having some difficulty getting my cross domain policy to work. I have an swf at http://www.server.com/ that loads in XML and other files. I want to be able to embed that swf in other HTML pages (YouTube stylee) that aren't in the same domain. It works fine when access via it's local server http://www.server.com/my.swf or http://www.server.com/swf.html but when I try to embed it won't load the XMLs and/or gives me a Security sandbox violation

The published SWF is set to Security.REMOTE

crossdomain.xml allows all:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"&gt;
<cross-domain-policy>
 <allow-access-from domain="*" to-ports="*"/>
</cross-domain-policy>

Hope you can help

UPDATE 1

An example of the embed code is:

<!-- Embedding -->
<object width='400' height='300'>
<param name='movie' value='http://www.server.com/my.swf'&gt;&lt;/param&gt;
<param name='allowFullScreen' value='true'></param>
<param name='allowscriptaccess' value='always'></param>
<param name='FlashVars' value="stream=1281002679" ></param>
<embed src='http://www.server.com/my.swf' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='400' height='300'></embed>
</object>

... which could be added to any webpage on any domain

UPDATE 2

policyfiles.txt (192.168.100.55 is my local testing server containing embedded example):

OK: Root-level SWF loaded: http://www.server.com/my.swf
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf
Warning: Failed to load policy file from http://192.168.100.55/crossdomain.xml
Error: Request for resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf is denied due to lack of policy file permissions.

flashlog.txt extract Warning: Failed to load policy file from http://192.168.100.55/crossdomain.xml

Do I need to load the crossdomain.xml via Security.loadPolicyFile('http://www.server.com/crossdmoain.xml')??

+1  A: 

error: Request for resource at http://192.168.100.55/data/configuration.xml?refresh=0.2777715688571334 by requestor from http://www.server.com/my.swf is denied due to lack of policy file permissions.

It looks like your swf tries to load the configuration file from your local server instead of your www.server.com

You should use an absolute path

David
What a goof. Thanks for all your help, paths it was.
Trist