Download an external SWF application in a new Air window with resize function

I am trying to load a local SWF application in my Air Application through the SWFLoader class. The class is SWFLoaderdisplayed in a new one Window. Therefore, I am trying to resize the window automatically when resizing the Flash application. But here is the problem. SWFLoader does not receive any events when the bootloader application has been modified.

The problem seems to be related to sand songs. I can call methods on childSandboxBridgeand objects parentSandboxBridgethat I set in the LoaderInfocontents of SWFLoaders (a loaded SWF application). But I can’t listen to any ResizeEvents or anything like that when I resize the downloaded application.

I am aware of a Loaderworkaround with the class and codeExecution property, but I don't want to get around Air Sandbox - if possible.

Can anyone help me with this?

Thanks in advance

+3
source share
2 answers

(Note: other issues with isolated software security may be part of your problems.) If your sandboxBridge is installed and you can call methods, although as you mentioned, you can send and receive events that bubble through SWFLoader (and they bubble across).

flash.events.Event bubbles = true, swf resizeEvent. (ResizeEvents ).

+2

, childSwf:

addEventListener(Event.ADDED,added)

function added(e){
    if (root.parent.parent){
    root.parent.parent.stage.addEventListener(Event.RESIZE, mainResizeHandler);
}

function mainResizeHandler(e:Event = null):void{
    trace("width: "+stage.stageWidth+" | height"+stage.stageHeight);
}
+1

Source: https://habr.com/ru/post/1735916/


All Articles