Category Archives: Adobe_AIR/FLEX

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 Implement Box2D in Adobe AIR?

By | February 4, 2011

Everyone will be fascinated how flash games are built on the web that implements the real world physics. Well for your information there are a lot of physics engines available. One of them is the Box2D. Box2D was written in C++. Then it was converted to flash. So now I am going to show you… Read More »

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 »

How to Skin your Alert or ToolTip in Adobe Flex using actionScript?

By | December 26, 2010

The code below does this . Simply copy and paste the following code.. applicationComplete=”init()”> Alert { color : #124332; background-color: #ffffff; header-colors : #243322, #243322; header-height:19; drop-shadow-enabled: true; drop-shadow-color :#243322; corner-radius :10; border-style :solid; border-thickness: 1; border-color : #243322; footer-colors : #243322, #ffffff; title-style-name : “title”; } .myalertstyle { backgroundAlpha: 0.3; backgroundColor: black; borderAlpha: 0.3;… Read More »

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.

By | December 26, 2010

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

How to change background of your window in code using adobe flex builder in actionscript?

By | December 26, 2010

The following code helps you to do this. It uses the “setStyle” property of the window to change it’s background style. The following code changes the background color of the window to black on a button click. Just copy and paste the following code. Call this function on the click of a button This code… Read More »