6/10/2010 1:32:58 AM
Title:
How to open multiple window in adobe Air app?
hii frieneds does any one know if yes then reply me...
Q:- in adobe air if one window is open how can we open multiple window saprately on our desktop and these window can control (open/close ) by my our main window.
1. one main window.
2 all child window should open on desktop not in any contanor.
3. when child window is close ones it can open from main window.
if u have any q? fell free to ask.
thanks in advance.
Inder
Points: 2880
Posts:0
6/10/2010 5:36:18 AM
Use the below code to create an Adobe AIR application , on button click open multiple winsdows on desktop. Chhild window can be opened from the base window if closed.
your main application/ window in Adobe AIR :
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" width="500" height="400">
<mx:Button click="openWin()" label="Open Multiple Windows"/>
<mx:Script>
<![CDATA[
private var myWin1:MyWindow;
private var myWin2:MyWindow;
private function openWin():void
{
myWin1 = new MyWindow();
myWin1.title = "Window1 created using Adobe AIR";
myWin1.maximizable=false;
myWin1.open();
myWin2 = new MyWindow();
myWin2.title = "Window2 created using Adobe AIR";
myWin2.maximizable=false;
myWin2.open();
}
]]>
</mx:Script>
</mx:WindowedApplication>
Create another file MyWindow.mxml with the following code. This file will be created as windows:
<?xml version="1.0" encoding="utf-8"?>
<mx:Window xmlns:mx="http://www.adobe.com/2006/mxml" transparent="false" systemChrome="standard"
backgroundColor="#FFFFFF" width="400" height="400" layout="vertical">
<mx:Label text="Window created by adobe air application "/>
</mx:Window>
6/10/2010 7:57:19 AM
thanks Inder was quite simple example
6/10/2010 8:18:50 AM
hii indre see u after so long time ..any way thanks 4 reply.
i got this solution in R&D.
can u tell me how i can skin these window and one problem when i put any custome commponent to this but the background functionality of the commp is wored on main window
for eg: if i click on butten (that open alert) on my cus. compnt. thit is in my window so that alert is not opening in my cust. commpt but opening in my main window.
thanks
Inder
Points: 2880
Posts:0
6/10/2010 11:05:22 AM
Hi gourav, I was on vacation , I am back now :)
For alert to open in the same window you need to tell the alert where to open by default it will go to parent window. Here is the code to use it Notice "this" in the last parameter.
Alert.show("This is my message","This is my Title",4,this)
Regarding the skinning , I don't think that, the system windows can be skinned , because they are using operating system windows and not flash windows. You can make them transparent and remove system window frame by setting the window properties in Window tag of your Adobe AIR application like this
<mx:Window systemChrome="none" type="lightweight" showFlexChrome="false" transparent="true" ....
6/10/2010 11:08:35 AM
gaurav check this for styling , hope its the same you are asking for
http://www.thetechlabs.com/tutorials/xml/exploring-runtime-styling-with-the-native-window-explorer-in-adobe-air/
http://justinimhoff.com/tutorial-on-using-runtime-skinning-in-adobe-air-applications/
6/2/2011 5:15:57 AM
can we run multiple main application window at a time in air ?
:)