Adobe AIR application + without appearing in Taskbar
While creating widgets the application should not appear on taskbar. But with AIR there is no such option to get rid of the application from taskbar.
I was searching the internet and I could find for Flex + AIR, but I could not find for Flash + AIR.
Here comes the Utility and Lightweight windows in action, these are type of native window but they will not appear on the taskbar.
But with only utility and lightweight windows we can’t make an application.
Initially we need to load our usual AIR application and close it launch a utility window and add contents to it that’s the trick.
Here is the code for it.
Standard Window:
this.stage.nativeWindow.close()
var nativeWindowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
nativeWindowOptions.type = NativeWindowType.UTILITY;
nativeWindowOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
var _nativeWindow:NativeWindow = new NativeWindow(nativeWindowOptions);
_nativeWindow.width = 300;
_nativeWindow.height = 300;
_nativeWindow.x = 400;
_nativeWindow.y = 300;
_nativeWindow.stage.align = “TL”;
_nativeWindow.stage.scaleMode = “noScale”;
_nativeWindow.title = “I am not at TaskBar”;
_nativeWindow.stage.addChild(new rose())
_nativeWindow.activate();
Explanation:
Here, we are closing the original NativeWindow
this.stage.nativeWindow.close()
And setting new nativewindow options, creating the new nativewindow.
One important thing to note here is to set the scalemode of the stage noScale otherwise the contents inside the newwindow is scaled.
Adding content to Utility or LightWeightWindow using
NativeWindow.stage.addChild( MovieClip, Sprite );
At last we need to activate the window using
NativeWindow.activate();
Custom Window:
While creating the custom window we should give an option to exit the application. Otherwise it will affect usability.
this.stage.nativeWindow.close()
var nativeWindowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
nativeWindowOptions.type = NativeWindowType.UTILITY;
nativeWindowOptions.systemChrome = NativeWindowSystemChrome.NONE;
nativeWindowOptions.transparent = true
var _nativeWindow:NativeWindow = new NativeWindow(nativeWindowOptions);
_nativeWindow.width = 300;
_nativeWindow.height = 300;
_nativeWindow.x = 400;
_nativeWindow.y = 300;
_nativeWindow.stage.align = “TL”;
_nativeWindow.stage.scaleMode = “noScale”;
_nativeWindow.title = “I am not at TaskBar”;
_nativeWindow.stage.addChild(new rose())
var _closeMC:closeMC = new closeMC();
_closeMC.x = 140
_closeMC.addEventListener(MouseEvent.CLICK, closeWindow)
_nativeWindow.stage.addChild( _closeMC );
_nativeWindow.activate();
function closeWindow( e:MouseEvent )
{
 _nativeWindow.close();
}
Explanation:
Setting systemChrome option to NONE and transparent property to true will remove the title bar too.
nativeWindowOptions.systemChrome = NativeWindowSystemChrome.NONE;
nativeWindowOptions.transparent = true
And to close the native window
NativeWindow.close();











































Leave your response!