I've created an AIR app with the minimeze() and close()
options. Now these functions are handled in the MainApp.mxml of the
application. But I want to move them to a class, so I don't have
any AS in my MXML file.
My app works like this now:
MainApp.mxml creates a new instance the Main.as class (which
extends MainVisual.mxml) by calling <mainVisual:Main /> in
MainVisual.mxml extends Canvas.
There I handle all visual elements of my app, but I can't get
a reference to the stage.nativeWindow here. Does anyone knows how
to do this?
Every display object, including the Canvas, has a stage
property. However, this property will be null until the Canvas
object is added to the stage. You can use the ADDED_TO_STAGE event
to detect when that happens.