IIRC, this has to do with the ApplicationDomain specified in the LoaderContext. 
 In the currently running Flash app, what ApplicationDomain settings are being 
used?
I think you will need to use the same settings with loadBytes.

Also, IIRC, if you were loading SWFs into a separate security sandbox on 
purpose (which would have the effect of each child SWF having its own styles), 
then you may have to explicitly set up a separate ApplicationDomain when using 
loadBytes.  And also note that loadBytes breaks the security sandbox so if you 
were relying on a security sandbox you no longer have one when using loadBytes 
and you should just be able to load the SWF in AIR without loadBytes and it 
should get its own security sandbox.

It has been so long since I answered questions on this topic that I could 
certainly be wrong...

HTH,
-Alex

On 9/6/19, 10:53 AM, "DarrenEvans" <darren.ev...@allocatesoftware.com> wrote:

    Not sure if this forum is still as active as it once was but I'll give it a
    go.......
    
    We have a massive Flex application that we are probably not going to have
    converted to HTML/JS by the time FlashPlayer is turned off at the end of
    2020.
    
    So as a stop gap solution we are going to try the locally installed Air App
    that downloads and the loads in the old SWF file (I see from previous posts
    this seems to be a popular approach).
    
    I'm using the "download SWF as bytes and load into a SWFLoader" approach. In
    a condensed form, basically this: 
    
        private function loadExternalSwfViaBytes(swfUrl:String):void {
                var urlRequest:URLRequest = new URLRequest(swfUrl);
                var urlLoader:URLLoader = new URLLoader();
                urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
                urlLoader.addEventListener(Event.COMPLETE, UrlLoaderComplete);
                urlLoader.load(urlRequest);
        }
    
        private function UrlLoaderComplete(event:Event):void {
                try {
                        var loader:URLLoader = URLLoader(event.target);
                        var context:LoaderContext = new LoaderContext();
                        context.allowLoadBytesCodeExecution = true;
                        swfLoader.loaderContext = context;
                        swfLoader.load(loader.data);
                } catch (e:Error) {
                        logEvent("UrlLoaderComplete Failed: " + e.message);
                }
        }
    
    The SWF successfully loads but not all the styles and skins from the SWF are
    being used. Styles and skins from the loading app are used instead. There
    are LOADS of styles and skins and it's not possible to load them all in the
    launching app.
    
    Is there anything that can be done to ensure all the styles and skins from
    the loaded SWF get used?
    
    
    
    --
    Sent from: 
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7Ca58b9fd41a4f476b4ba208d732f32585%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C637033892198156774&amp;sdata=Y12RsZ%2BhiuK5y8ZpQrhTlqd%2BsNZ2npZQl5fHzGp%2FOhY%3D&amp;reserved=0
    

Reply via email to