Tag Archives: new

Access a remote database from Adobe AIR or FLEX.

By | February 8, 2011

Access a remote database from Adobe AIR or FLEX. Many often you need to access online database from your application. For doing it in Adobe AIR of FLEX you need HttpService. The following example shows how to access an online database from an AIR Application. Note that you cannot return an array from a remote… Read More »

Crop an Image in Adobe AIR or Flex.

By | February 7, 2011

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);

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.

Pass a variable from one window to another in Adobe AIR?

By | February 6, 2011

We often need to access another window variable in the current window. The following example shows how to access a variable from one window in the next window. The logic is to create an object of next window in the current window and assign the value of variable in the current window itself so that… Read More »

Create a polygon in Flash or Adobe AIR using Box2D.

By | February 5, 2011

The below function creates a polygon in the shape of a triangle. Please call the debugdraw function inside your update method to view the results. Make sure you import the Box2D classes into your file. public function init():void { debug_draw(); addEventListener(Event.ENTER_FRAME, update); createTriangle(); } public function createTriangle():void { var fd : b2FixtureDef = new b2FixtureDef();… Read More »

How to add infinite backgrounds in Cocos2D, iphone?

By | December 24, 2010

You often may need scrolling backgrounds in your game or any other application. The following code helps you to add continuous backgrounds. Each sprite is added to the right of the current sprite which make them continuos. //Add more stripes, flip them, and position them next to their neighbour stripe. for (int i = 0;… Read More »