I have an issue loading a child Flex 4 application into (for now) a very basic shell app, within a new NativeWindow. The SWFLoader loads the child and starts it up without problems, except that it seems to be scaled at around 1000%. I've checked the scaling of everything and it's all set to 1, so there is nothing strange going on under Flex's hood.
Here is the code I'm using to load:
<?xml version="1.0" encoding="utf-8"?>
private var childApp : NativeWindow;
private var loader : SWFLoader;
private function launchChildApp() : void
var options : NativeWindowInitOptions = new NativeWindowInitOptions();
childApp = new NativeWindow( options );
loader = new SWFLoader();
loader.loadForCompatibility = true;
// Neither of the following make any difference
loader.maintainAspectRatio = false;
loader.scaleContent = false;
loader.addEventListener( Event.COMPLETE, onInit );
loader.load( "ChildApp.swf" );
private function onInit( event : Event ) : void
childApp.stage.addChild( loader.content );
label="Launch child application"
I've tried setting loadForCompatibility to false, and this yields a blank white screen, yet both apps are compiled with the same Flex 4 SDK version.
Anyone seen any behaviour like this before - am I missing something?
I don't think you can use NativeWindow like that with Flex. It is an AIR
native class and doesn't know how to participate in the Flex infrastructure.
Create a s:Window instead.
Top man, thanks! Knew it would be something stupid I'd missed.