Link to home
Start Free TrialLog in
Avatar of medxmedia
medxmedia

asked on

Adding external content to new NativeWindow in Adobe Air

Hi,

I'm working on an Air application that I am building using flash professional CS5.  I have a new native window and am able to add some content (e.g. a text field) to it, but cannot add loaded files.  I have testetd the loader with the default window and its content is added as expected, but using the same method (addChild) with the new native window does not add the loaded content.

I'd appreciate any ideas you may have on how to resolve this.

Best,

C.S.
Avatar of dgofman
dgofman
Flag of United States of America image

Avatar of medxmedia
medxmedia

ASKER

Hi dgofman,

Thanks for your reply.  The link you provided references flash builder.  In Flash, "addElelment" throws an error.
Can you attach some sample of your project I would like to run locally on my machine?
ASKER CERTIFIED SOLUTION
Avatar of medxmedia
medxmedia

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, now is clear for me.
Yes you have to use code bellow

newWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
newWindow.stage.align = StageAlign.TOP_LEFT;

var bitmap:Bitmap = AppLoader.content as Bitmap;
newWindow.stage.addChild(bitmap);  
newWindow.activate();

for AIR application the NativeWindow class represent as popup window and you cannot apply scaling (like Alert dialogs)
I think  
In the precending code, you've also avoided the deformation of the objects on the stage by setting the scaleMode property to StageScaleMode.NO_SCALE.
I stumbled on to my own solution.