views:

385

answers:

2

is it possible can set lightweight type for window application . because i don't want window application icon shows on taskbar . so if it is not possiable ? How can i do ? anybody help me for that

+1  A: 

Below is the code you can use:

var window:Window = new Window(); // OR var window:BlankWindow = new BlankWindow();
window.type = NativeWindowType.LIGHTWEIGHT;
window.open(true);

Where BlankWindow is an mxml file like so:

<?xml version="1.0" encoding="utf-8"?>
<mx:Window xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<!-- Your Code Here -->
</mx:Window>

Hope this helps.

Daniel
var window:BlankWindow = new BlankWindow(); throws some error like undefine window . whcih class will i import . i tried import flash.display.NativeWindow; But throws same error . could u help me Daiel
R.Vijayakumar
Did you create a BlankWindow.mxml and import it? For example in your src/ folder you have a com/ folder, and in that com/ folder you have the file BlankWindow.mxml and then at the top of your application trying to open the window you add: Import com.BlankWindow; Then you should be able to add an instance of the BlankWindow. If you just want to open a standard window use: var window:Window = new Window();
Daniel
<mx:WindowedApplication type="LIGHTWEIGHT"/> is it possiable ? Daniel.
R.Vijayakumar
i created blank window and also import the blank window into main application. but shows error like undfine window . import com.blankwindow also
R.Vijayakumar
Please, post the code you are using, and a simple list of the file structure you have if possible.
Daniel
A: 

Try this. Create two .mxml files. You should have Main.mxml and BlankWindow.mxml

In your Main-app.xml configuration settings make sure the following is set:

<initialWindow>
    ...
    <visible>false</visible>
    ...
</initialWindow>

Now, in your Main.mxml you are going to want to add the following to your 'creationComplete' handler:

var window:BlankWindow = new BlankWindow();
window.type = NativeWindowType.LIGHTWEIGHT;
window.open(true);

And, in your BlankWindow.mxml, you put the information that you want your application to display. There is no way for the default application window to be set to Lightweight. The only way around it is by hiding the main window, and opening a secondary window.

Also, make sure to close the primary window when the secondary window closes, or else your application will not exit properly.

Daniel