The FlashChemist!

My Experiments and Thoughts on the Flash Platform

Archive for the ‘AIR’ Category

Creating AS 3.0 AIR Projects in Flex Builder 3.0 /Flash Builder 4.0

leave a comment

While this is an ideal choice of making AIR desktop applications for those who does not want the Flex framework, I am still surprised that Adobe didn’t add this option to its new IDE product, Flash Builder 4.0. Flex/Flash Builder being the best AS 3.0 editor so far, this option is really missing.

There is a bug in the Adobe JIRA – https://bugs.adobe.com/jira/browse/FB-9303 . But honestly, this looks like a natural choice for Adobe (!?)

I was using a hack for making this work with Flex Builder 3.0 and same works for Flash Builder 4.0. Its is a simple method though:

In the Flex/Flash Builder IDE, select ‘New >> Project’ and select ‘Flex Project’ option.

From the Wizard, please select ‘Desktop Application (Runs on AIR)’, give a project name and click ‘Next’ button instead of your usual ‘Finish’ button.

The next screen prompts for defining the folder for debug. Leave it as is, unless you want to, and click on ‘Next’ button.

The next screen is where you have to do some magic. Here it is.

Change the file extension of ‘Main Application file’ from .mxml to .as — nothing else.

Now click your favourite ‘Finish’ button, and you are set. But, if you run your project, it doesnt show up; this is because the visibilty option of your native window is set to ‘false’ by default. So, open up your application XML file (That will be in the root and named ProjectName-app.xml), and uncomment the sub node of the node and set it to true. Here is how it will look like:

Now, you have your AS3 AIR project, and you have access to all the AIR API’s, and your ’stage’ attribute will have the AIR related properties.

Workaround, still works nice. Adobe, we need this option from the wizard.

Written by Vipin

June 1st, 2010 at 2:47 pm

Posted in AIR, Flash

Tagged with , , , ,

Get AIR 2.0 SDK Work on Your Flex Builder 3.0

3 comments

I have been trying to get AIR 2.0 beta work on my Flex Builder 3.0 on Windows (I am using XP, but it should be more or less same on all Win boxes). I didnt find any straight forward tutorial from anyone which takes us the step-by-step way :)

I did make it work, so here is how:

Its obvious that you will have Flex Builder 3.0 installed on your machine. I am using Flex Builder 3.0 plug-in on Eclipse Ganymede.

Download the AIR 2.0 beta SDK from Adobe Labs. Its a zip file which is intended to ovelay your current SDK, that means its a collection of files which are going to replace your current files in the SDK folder.

Next, make a copy of your latest SDK. I am using 3.4.0, so I made a copy of that folder and named it ‘3.4.0.air.2.0beta’. Hope you know where will be the SDK placed. For me it was under ‘C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks’. It may vary for you.

Copy the downloaded zip file inside this SDK folder you created new (3.4.0.air.2.0beta). Right click and say unzip/unarchive/extract all or whatever the utility you are using is saying.

Here, you need to make sure that you are not extracting the zip to a new folder. You should extract the contents of the zip to the root of the folder ‘3.4.0.air.2.0beta’. Make sure you mention to overwrite the files while unzipping. It basically gets you new airglobal.swc and other supporting files (like adl).

Now go back to your project explorer, and create new AIR project.

Right click on the project and select ‘Properties’ and move to ‘Flex Compiler’ tab (shown below)

Click on the ‘Configure Flex SDK’ link. It will open the Flex SDK configuration window (shown below)

Click on Add and add your new SDK you created now (for me the folder ‘3.4.0.air.2.0beta’ and I named it 3.4.0 AIR2). Click OK.

Come back to the project properties window, and select the new SDK from the list (as shown below). You need to select the ‘Use specific SDK radio button, and select the new SDK from the list.

Now you have your AIR 2.0 beta SDK set-up. But this is not it, you have to do one more thing. Open up your application XML file (it should be named ‘YourProjectName-app.xml’. You have to change namespace to 2.0beta if its not set already. The top part of the file will look like below:

http://ns.adobe.com/air/application/1.5.3 will become http://ns.adobe.com/air/application/2.0beta

Now, you should have access to all of your AIR 2.0 api’s. If you are using OS specific API’s like NativeProcess, File.openWithDefaultApplication() methods, you need to add one more tag to your application XML. Please see the tag in the above picture.

Now, hopefully you have everything working with new SDK.

If you are a MAC user, follow this post which tells you how to do it on a MAC OSX.

Hope it helps someone. Happy beta testing… Let me…no no Let Adobe know if you have any issues with the new SDK ;)

Written by Vipin

March 3rd, 2010 at 4:32 pm

Posted in AIR

Tagged with

New Print Features in Adobe AIR 2.0 beta 2

leave a comment

Here is a video interview by Ryan Stewart with Rick Rocheleau on the new features available in Adobe AIR 2.0 beta 2. The new beta is now available inĀ adobe labs.

ThanksĀ Peter Elst for sharing this video on his blog.

Written by Vipin

February 28th, 2010 at 6:31 am

Posted in AIR

Tagged with