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

Flash 8 - AS2 - Cross domain XML load error

LEGEND ,
Jan 24, 2008 Jan 24, 2008

Hi there,

I'm having some problems with loading a xml file.
Got a swf that must load a xml file from a different server.
For different domain I inserted this code:

System.exactSettings = false;
System.security.allowDomain ("domain.com");

On the html markup file I inserted:

'allowScriptAccess', 'domain.com',

Running on Flash IDE it all goes right, but once online there is always an
xml load error.

Can anyone help me?

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
Guru ,
Jan 24, 2008 Jan 24, 2008
In order for your swf to load data from a different domain it requires a crossdomain.xml permission file at the other server to grant access to the domain where your swf resides.

The other option is to proxy the request through a serverside script e.g. php from your own domain, so that for all intents and purposes, your swf assumes its loading the data from your domain.
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
Guru ,
Jan 24, 2008 Jan 24, 2008
So a file similar to the following needs to be placed in the root directory of the other site that you are loading from... with the domain name in the file granting permission to your site.

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 ,
Jan 24, 2008 Jan 24, 2008
I GWD,

Thanks for the reply.
In the case bellow must I then make a reference to this xml file in the
flash?

I.e. System.security.loadPolicyFile(" http://foo.com/sub/dir/file.xml");

What about the php file. would you be kind to show me an example?

Regards
Peter


"GWD" <webforumsuser@macromedia.com> escreveu na mensagem
news:fnaq3k$rk4$1@forums.macromedia.com...
> In order for your swf to load data from a different domain it requires a
> crossdomain.xml permission file at the other server to grant access to the
> domain where your swf resides.
>
> The other option is to proxy the request through a serverside script e.g.
> php
> from your own domain, so that for all intents and purposes, your swf
> assumes
> its loading the data from your domain.
>
>
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
Guru ,
Jan 24, 2008 Jan 24, 2008
LATEST
If its not in the root directory on the other site then yes you will need to load it first from the specific location. You normally don't need to do this if its in the main root location at the other site.
But there are some limitations with putting the file in a custom location. You should read this info:
http://livedocs.adobe.com/flash/9.0/main/00001086.html#wp250063

If you have the crossdomain permission set up correctly then you don't need to use the php option to proxy the requests through your own domain. I've never needed to use it (yet) so I don't have an example to show you. But others here in the forum have so may post an example.


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