views:

253

answers:

2

Hi,

I have to load xml from external domain , so my code looks like this...

var loader:URLLoader = new URLLoader();
        configureListeners(loader);

        var request:URLRequest = new URLRequest("http://demo.softsolutions4u.com/ss4uplayer/modules/podcast/lib/PlayerAPI.php");
        try {
            loader.load(request);
        } catch (error:Error) {
            trace("Unable to load requested document.");
        }

        function configureListeners(dispatcher:IEventDispatcher):void {
            dispatcher.addEventListener(Event.COMPLETE, completeHandler);
            dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
         }

        function completeHandler(event:Event):void {
            var loader:URLLoader = URLLoader(event.target);
            trace("completeHandler: " + loader.data);
            datas.appendText("completeHandler: " +loader.data);
        }


        function securityErrorHandler(event:SecurityErrorEvent):void {
            trace("securityErrorHandler: " + event);
            datas.appendText("securityErrorHandler: " +event);
        }

But it throws exeception at run time

securityErrorHandler: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048: Security sandbox violation: http://192.168.2.55/onlinemovie/Development/SS4UPlayer310310/test.swf cannot load data from http://demo.softsolutions4u.com/ss4uplayer/modules/podcast/lib/PlayerAPI.php."

crossdomain xml file also loaded and security allodomain is in(*). Please tell me what i missed here...

+1  A: 

I don't see crossdomain.xml at the location http://demo.softsolutions4u.com/crossdomain.xml, it returns a 404 error. You should place the crossdomain.xml at the root of the domain and try again.

sri
Hi, thanks for your reply. No, its not like that. Am not going to use the flash swf file, but our N no of clients going to use this swf in their server, so then how could i place the crossdomain.xml. I dont knw wher i should put it. please show me the way to fix it.
Ela
+1  A: 

Try adding this line

Security.allowInsecureDomain("demo.softsolutions4u.com");

You should be able to test the movie ONLY inside the Flash IDE or on the client server

VIT
hi, thanks for your reply. instead of this i made this one. Security.allowInsecureDomain("*"); for this itself not working. ok let me try this also.
Ela