Tag Archives: AIR

How to drag and drop a file from outside to your flex or AIR application and render it correctly?

By | April 7, 2012

Actually we have to do this by registering your application with the eventlisteners for NATIVE_DRAG_ENTER and NATIVE_DRAG_DROP. The following code shows how to do this. Just copy and paste the code to your MXML file and see the result. Drag and drop an image file from outside to your AIR application. import mx.controls.Alert; import mx.controls.Image;… Read More »

How to open a new window in Adobe AIR?

By | April 7, 2011

Hi all …. In this example I will show you how to open a new window from an adobe AIR Application. First you create a new Flex Project and named FirstWindow. Now you have FirstWindow.mxml in your project. Go on open it and copy the following code to it. Now right click on the src… Read More »

How to dynamically add controls in Adobe AIR or Flex?

By | February 14, 2011

Below example shows how to add a label control dynamically in AIR or FLEX. var L : Label = new Label(); L.addEventListener(MouseEvent.CLICK,LabelListener); L.name = “my_label_name”; L.text = “my Text”; addChild(L); // This function listens to the mouse click in the above added label. private function LabelListener(event:MouseEvent):void { } Please note that you can add any… Read More »

Dynamically change the background of a window in Adobe AIR?

By | February 6, 2011

Change the background of your window with your selected image. Copy and paste the following code to your AIR file and view the result. Note: Please make sure that you have an image in your application source folder. Here the image name is “image.jpg” else you will get URL not found error.

How to read and write an XML file in Adobe AIR or Flex?

By | January 15, 2011

AIR treats the XML files as just as normal file and so you can proceed using the FileStream classs. Please take a look at the sample code. Just copy and paste the following code to your main.MXML file and you are done. Please post your comments on this post

Add Context menu in Adobe AIR or FLEX.

By | January 15, 2011

This sample shows how to add a menu to your context menu or the right click of your menu in Adobe AIR. AIR Uses the ContextMenu class to add menu to your mouse right click. import flash.events.ContextMenuEvent; import mx.controls.Alert; // call this function to create context menu in AIR and FLex private function createContextMenu():void {… Read More »