How do I make an AIR Window be always on top?
This question comes in from Martijn:
hi, thanks for posting that stuff about minimizing the adobe air window :) I wondered if you also know if air supports the native window to be "always on top" on your desktop. I can't find anything about the subject. Thanks, Martijn
I've done some experiments with this in the past, but couldn't find my old code. The WindowsApplication tag has an alwaysInFront property.
To make an app always stay on top, just do this:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" alwaysInFront="true">
</mx:WindowedApplication>
In my experiments, I was testing out AIR to run in Kiosk mode application, so I was also using alwaysInFront with a full screen. You can make things full screen by doing this:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" alwaysInFront="true"
applicationComplete="onApplicationComplete()">
<mx:Script><![CDATA[
public function onApplicationComplete():void{
this.stage.displayState = StageDisplayState.FULL_SCREEN;
}
]]></mx:Script>
</mx:WindowedApplication>
Using the ApplicationComplete event, I trigger a function to run this in "large" mode. It just sets the displayState of the stage into Full Screen. You cannot run this code on CreationComplete because the Application stage object is not initialized before the ApplicationComplete event is triggered.
Did I mention I love answering questions? You should feel free to ask away.





I can't help w/ Flash CS3, sorry.
http://www.adobe.com/devnet/air/flash/quickstart/c...
In Flash CS3/CS4 (AS3) you can add this to your code:
stage.nativeWindow.alwaysInFront = true;
Thanks for the knowledge.
You are wonderful, Thank You so much.