Adobe Air Archives

Air Application window formatting tips

Open your project in flex builder, then open the <appln. name>-app.xml file from the src folder.

Inside the <initialWindow></initialWindow>, there is one tag <title></title> , uncomment it and enter the Application title there. Eg: <title>My Application Window Title</title>

If you want to change the appearance of the window, uncomment the <systemChrome></systemChrome> tags and enter none in it. Eg: <systemChrome>none</systemChrome> , also uncomment the <transparent></transparent> tags and enter true in it. Eg: <transparent>true</transparent>.

If you want to disable the maximize button, uncomment the <maximizable></maximizable> tags and enter false in it. Eg: <maximizable>false</maximizable>

If you want to disable  window resizing, uncomment the <maximizable>false</maximizable> tags and enter false in it. Eg: <maximizable>false</maximizable>

If you want to add Icons to your application, uncomment <icon></icon> tags, and copy your icon images to your application’s src folder and enter image name in the <image>tags just ike following:

<image16x16>icon_16.png</image16x16>
<image32x32>icon_32.png</image32x32>
<image48x48>icon_48.png</image48x48>
<image128x128>icon_128.png</image128x128>


Create menu

All menus  in Air are NativeMenu objects.
Menu items are NativeMenuItem objects.
You can place Submenus within a parent
NativeMenu object.Also you can use event listeners to
associate menu item selection with a function.

To show a sample menu, You can use the following code.

After executing You can see the result as

Incoming search terms:

  • 2010May|Web eCommerce iOS Android ArduinoandSEO

You can air sdk to compile an AIR application to show an HTML Page. Try the steps given below:

1. Create an HTML File with the following code and saved it as HelloWorld.html:

2. Created an xml file with the following code and save it as app.xml

<application xmlns=”http://ns.adobe.com/air/application/1.0″>

3. Save these two files in a new directory. Here I have stored in D:\HelloWorld .

4. Then go to your flex folder using command prompt as shown in the figure given below and type the command:

5. You will get an output as the figure shown below:

Note: You should note the version of adl installed in your PC with the version given in your xml file.

That’s it. You have done!!!

MP3 Player in AIR

A simple AIR application Program to Play, Stop and Resume the MP3 sound.

Program:-

//MP3Player.mxml

Output:-



When the user inputs a name in the textbox and press the search button , the name is appended to the given URL and it is sent.  Then the details of the given name is get displayed in the text area.    The code is given below.

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:WindowedApplication xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute”>

<mx:Script>
<![CDATA[
private var myUrl:String ="http://schogini.co.in/mca/mca2.php?name=";
//private var myUrl:String ="http://";
private function passUrl():void
{ //function for navigating to the url.

var userName : String;
userName = nameInput.text;
// To append the input name to the url
myUrl = myUrl + userName;

var url = new URLRequest(myUrl);
//navigateToURL(url);

//Add event Listener
var loader = new URLLoader();
loader.addEventListener(Event.COMPLETE,loadComplete);

//load the resource
loader.load(url);

//Function that handles the complete loading of the details
function loadComplete():void
{
outputdetails.text = loader.data;

}
}
]]>
</mx:Script>

<mx:Label x=”94″ y=”35″ text=”Name” width=”160″ id=”namelb” fontWeight=”bold” fontSize=”20″ fontFamily=”Georgia”/>
<mx:TextInput x=”208″ y=”35″ id=”nameInput” height=”26″/>
<mx:Button x=”388″ y=”33″ label=”Search” id=”searchbtn” click=”passUrl();” fontSize=”15″/>
<mx:TextArea x=”10″ y=”91″ id=”outputdetails” height=”239″ width=”529″/>
</mx:WindowedApplication>

Output

This is a simple program to resize an  image which is loaded from the user’s system. This image can be  zoom-in or zoom-out using a Horizontal Slider(HSlider).The code is shown below….



The output look like this…….