The below code is for FlashBuilder 4, If you are using FlexBuilder3 use addChild() instead of the commented block in the following code.
Hi all… In this tutorial I will show you how to add links in a menu in Adobe AIR/ FLEX. It is really simple. Just add a normal menu item and on the click handler for menu items match the label and navigate to the URL, that’s all. Check out this example. Change the mx:Application to mx:windowedApplication to… Read More »
Often in out applications we need to play sounds , so this code explains how to play, stop and resume an mp3 sound in Adobe AIR/FLEX. What you have to do is to copy the following code and place it inside your “mx:Script” tag. After that place three buttons for play, pause and stop and connect it to… Read More »
Below code shows how to crop an image in Adobe AIR. Change the mx:WindowedApplication to mx: Application to run it as a FLEX Application. The code uses copyPixels to extract the desired part from the image file. The important line in the below code crops the image. cropBD.copyPixels(loadBD, new Rectangle(startPoint.x, startPoint.y, squareSize, squareSize),posPoint);
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.
In the following code the navigateToURL property is navigating to the same page which creates the refreshing of the page.