Search code examples
flashactionscript-3apache-flexairmxml

How to access NativeWindow in pure AS3 AIR project


I'm getting crazy because I can't access object NativeWindow in a "ActionScript Mobile Project", no matter what I do stage.nativeWindow is always null when I test on desktop. If I create a new NativeWindow then it's the stage property that is null. Oddly enough accessing stage.NativeWindow works when deploying on blackberry playbook but not when debugging configuration Launch Method on desktop.

Can't answer my own question but it seems the feature is just unsupported on the desktop I guess the workaround is use Stage.Resize when debugging desktop.

reference: The window represents the native operating system window; the Stage represents the content contained by the window. This property is only valid for content running in AIR on platforms that support the NativeWindow class. On other platforms, this property will be null. In Flash Player (content running in a browser), this property will also be null.


Solution

  • You can't access nativeWindow in mobile devices it's not supported. Check this page it's - unsupported apis on mobile devices http://help.adobe.com/en_US/as3/iphone/WS789ea67d3e73a8b24b55b57a124b32b5b57-7fff.html