Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

System.security.loadPolicyFile

Engaged ,
Dec 05, 2008 Dec 05, 2008
Hi, I'm attempting to load a crossdomain.xml file from a folder. I have an ad banner and my client wants all the jpgs and xml file to live on amazon's s3 server, so I of course need a crossdomain.xml file. But it can't live on the root of the domain. So I've tried using System.security.loadPolicyFile(" http://s3.amazonaws.com/theirfolder/crossdomain.xml");
but this isn't working. I've put the .swf on another server, added that domain to the crossdomain.xml file, then tested it. In my browser activity window I see that the swf is loading http://s3.amazonaws.com/theirfolder/crossdomain.xml, but it is also looking for http://s3.amazonaws.com/crossdomain.xml. And my xml file and jpgs aren't loading.

Does anyone have any advice? The ad must be in AS2, Flash 8.

My code is just this line on the .swf's main timeline:
System.security.loadPolicyFile(" http://s3.amazonaws.com/theirfolder/crossdomain.xml");

am I missing something?

Thanks!
TOPICS
ActionScript
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Apr 02, 2009 Apr 02, 2009
So dropping System is the trick.

ex: Security.loadPolicyFile(' http://www.whateverDomain/somefolder/crossdomain.xml');

cool. Thanks!
Translate
LEGEND ,
Dec 06, 2008 Dec 06, 2008
Does crossdomain.xml exist in theirfolder? I assume it does.

I checked http://s3.amazonaws.com/crossdomain.xml and, unfortunately, it loads an xml. I am not sure but Flash may interpret it differently than if crossdomain.xml did not exist and there was, say, 404 error.

Also, you may want to try to change the order of loading xmls - your crossdomain after Flash attempts to load http://s3.amazonaws.com/crossdomain.xml to override it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 14, 2008 Dec 14, 2008
Thanks for your reply. I moved the files to my server for testing. And I noticed that even though I have:

System.security.loadPolicyFile(" http://mysite.com/clientfolder/crossdomain.xml");

I see in my browser's activity window that the .swf does load http://mysite.com/clientfolder/crossdomain.xml first, but then tries to load http://mysite.com/crossdomain.xml, which does not exist. And I still can't load in any files. When I move I move the crossdomain.xml to my servers root ( http://mysite.com/crossdomain.xml), it works. My .swf doesn't seem to be listening to System.security.loadPolicyFile. Any clues?

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 14, 2008 Dec 14, 2008
Try to load first xml from domain root and then from the folder. In other words - make two lines for loading policies. I don't like it but it is worth trying:

System.security.loadPolicyFile(" http://mysite.com/crossdomain.xml");
System.security.loadPolicyFile(" http://mysite.com/clientfolder/crossdomain.xml");

This way it will, hopefully, override loading from the root.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 14, 2008 Dec 14, 2008
Thanks. I tried what you suggested. The .swf is still looking for both policy files, and still wont load the other files. Has anyone gotten System.security.loadPolicyFile to work?

peace.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 02, 2009 Apr 02, 2009
I'm having exactley the same problem as Andrei1. Anyone found a solution to this?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 02, 2009 Apr 02, 2009
I wish I could help but I haven't been able to get System.security.loadPolicyFile() to work, and can't find anyone who has. Anyone at Adobe able to help us?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 02, 2009 Apr 02, 2009
This is what I use and I don't have any issues with it.

Security.loadPolicyFile(' http://www.whateverDomain/crossdomain.xml');

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 02, 2009 Apr 02, 2009
yes that works, but if you read this whole post, the issue is that this doesn't work:

Security.loadPolicyFile(' http://www.whateverDomain/somefolder/crossdomain.xml');

and according to Adobe's documentation, it is suppose to work.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 02, 2009 Apr 02, 2009
Well are you granting access from your domain in the cross-domain file?

In my case I have data(videos, images, etc) stored on a content delivery network, so I don't have access to the root itself, so when I request data from my secured server to the CDN I use Security.loadPolicyFile(' http://www.whateverDomain/crossdomain.xml'); dropping the 'System.' off the loaPolicyFile line and everything works; it never keeps looking for an additional policy file.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 02, 2009 Apr 02, 2009
I hadn't noticed that you removed System. Have you successfully loaded a crossdomain file from a sub directory?

ex: Security.loadPolicyFile(' http://www.whateverDomain/somefolder/crossdomain.xml');

Thanks!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 02, 2009 Apr 02, 2009
Yeah I don't have any issue with a sub-directory either.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 02, 2009 Apr 02, 2009
So dropping System is the trick.

ex: Security.loadPolicyFile(' http://www.whateverDomain/somefolder/crossdomain.xml');

cool. Thanks!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 02, 2009 Apr 02, 2009
LATEST
Glad I could help you out.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines