Tag Archives: addEventListener

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

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; import flash.filesystem.File; private… Read More »

Dynamically change the background of a window in Adobe AIR?

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?

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

How do you call an actionscript function from a html page and viceversa. How to you access the actionscript variable function from an HTML page in actionscript.

The following code helps you to do this. Save the following  code as am .mxml file The html file start.html