0

I am creating a flash project where I load data from server. When I run that from flash software using Ctrl+Enter or create exe then that works but when I run swf normally or using a browser then it is not working.

I tried to add this code but not working

Security.loadPolicyFile("policy.xml");
or
Security.allowDomain("192.168.10.8");
Security.allowDomain("www.example.com");

My policy.xml is

<cross-domain-policy> 
    <allow-access-from domain="*" /> 
    <allow-access-from domain="www.example.com" /> 
    <allow-access-from domain="192.168.10.8" /> 
</cross-domain-policy>

Please advice me.

Sarwar Hasan
  • 1,561
  • 2
  • 17
  • 25

3 Answers3

0

I had a similar problem. Flash will initially try to get the flash policy from a different port (843). See this: http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html

Tereus Scott
  • 674
  • 1
  • 6
  • 11
0

Why not try use URLlaoder? and set up a web with service call.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLLoader.html

Bill
  • 17,872
  • 19
  • 83
  • 131
0

I suggest to try LoaderContext class. Here is example code:

Security.allowDomain("*");
Security.allowInsecureDomain("*");

var loader:URLLoader = new URLLoader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onDataLoaded);
loader.load(new URLRequest("http://www.example.com/json_file_path.json"), new LoaderContext(true));
ismail simsek
  • 28
  • 1
  • 4