Skip to main content
Participant
August 21, 2019
Question

How do I download and display the swf files which are located remote server?

  • August 21, 2019
  • 1 reply
  • 777 views

I'd like to download and display the swf files which are located remote server like this.

I made sample program and tried to download 2 swf files from remote server.

The result was as follows.

Client PC (OS:Windows 10)

Remote Server (OS:Windows Server 2016 Standard)
        Sample program could download and display sample1.swf file which built by flex3 SDK.

Sample program couldn't download and display sample2.swf file which built by flex2 SDK

The cause of the error was Security Sandbox Violation.

SecurityError: Error #2047:  Security Sandbox Violation :

    at flash.display::DisplayObject/get parent()

    at mx.managers::SystemManager/executeCallbacks()

    at mx.managers::SystemManager/docFrameHandler()

I debugged my program and found that the Security Sandbox Violation was occurred also in case that my program could download and display sample1.swf.

Does anyone know how to solve the Security Sandbox Violation and download and display the swf files which are located remote server?

Sample program.

<?xml version="1.0" encoding="utf-8"?>

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="creationCompleteHandler(event)"

    width="600" height="500">

            <mx:Canvas width="100%" height="100%">

                <mx:SWFLoader id="sampleLoader" loaderContext="{loaderContext}"/>

            </mx:Canvas>

    <mx:Script>

        <![CDATA[

            import flash.display.*;

            import mx.core.UIComponent;

            import mx.events.FlexEvent;

           

            [Bindable]

            private var loaderContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);

       

             public function creationCompleteHandler(event:Event):void

             {

                 sampleLoader.load("URL_OF_REMOTE_SWF_FILE");

             }

                   

        ]]>

    </mx:Script>       

       

</mx:WindowedApplication>

This topic has been closed for replies.

1 reply

natural_criticB837
Legend
August 21, 2019

It's been a while for me to do something like this, but try to call the following code in your remote swf:

Security.allowDomain("*");

Security.allowInsecureDomain("*");