Jul 14, 2011

Adobe releases Air 3 Beta and Flash 11 Beta

Just read flashmagazine's article on the release of Adobe AIR 3 Beta and Flash 11 Beta.
I don't think one should go out and try every Beta version but I do like to see what's coming up. Here are the links:

Adobe AIR 3 Beta
Adobe Flash 11 Beta

Jul 4, 2011

Flash to HTM5 converter by Google

How can you enable iPhone/iPad/iPod users to access your website's flash content?

Option #1: Teach them how to jailbreak their device
Option #2: Create from scratch html fallbacks for all that flash content on your website
Option #3: Automatically convert all flash content using Google Swiffy.

This Google Labs tool will convert most flash content to HTML5. The result will be visible on any Webkit-based browser (such as Safari or Chrome).
Check the swiffy gallery and FAQ for more info.

Jun 30, 2011

Download Old Adobe AIR Runtimes or SDKs

For many times I needed to download a specific version of the Adobe AIR runtime or of the sdk. Unfortunately when you search for a specific runtime or sdk version in Google you will not easily find Adobe's official page, so here it is:

Archived Adobe AIR runtime, SDK versions

Jun 28, 2011

Migrating Flex 3 project to Flex 4.5

I've been migrating my Flex/Air project from the old Flex 3.5 and AIR 2.0 sdks to the shining new Flex 4.5.1 and AIR 2.7 and... inevitably I ran into a few problems. Here's my experience, hoping it will help someone else endure this process more easily.

Mise en place

    Here We Go
    • Merged the new sdks into a folder named "Flex 4.5.1 with AIR 2.7" (here's a good reference on "How to Overlay the AIR SDK for Use With the Flex SDK"
    • Opened my project in Flash Builder 3 and set the compiler setting to reference the new sdk:
      • Under Properties > Flex Compiler > Configure Flex SDKs clicked "Add..." 
      • Browsed to the "Flex 4.5.1 with AIR 2.7" folder"
      • Set the Flex SDK version to the new sdk
    And this is where the problem solving started.

    Problem #1
    A bunch of errors and warnings appeared in the "Problems" view. These will depend on each project and are usually self-explained and easy to solve, so I just leave an example:

    "3608: 'application' has been deprecated since 4.0.  Please use 'FlexGlobals.topLevelApplication'."

    Just replace every "Application.application" reference in your project with "FlexGlobals.topLevelApplication". Remember to also replace the "import mx.core.Application" with "import mx.core.FlexGlobals".

    After cleaning up all errors and warnings I tried to debug the application, which brought me to Problem #2.

    Problem #2
    "Process terminated without establishing connection to debugger. error while loading initial content"

    This error basically meant that I had to update the air namespace of my application. To solve it I opened the application's descriptor file (that file that is automatically created with every new application and ends in "...-app.xml", something like "myAppTest-app.xml") and made sure the air namespace matched the one in the sdk:

    <application xmlns="http://ns.adobe.com/air/application/2.7">

    Now that this was solved, I tried again to debug the app, bringing Problem #3.

    Problem #3
    invalid application descriptor: versionNumber must have a non-empty value.

    This problem was produced by a mismatch in the application's descriptor file. Each AIR sdk tends to have it's own application descriptor file formatting which means that an application that was created with AIR 2.0 must "migrate" its descriptor file to the new AIR 2.7 sdk. My suggestion is creating from scratch a new project that targets the new sdk, just so we can take its descriptor file, copy/paste it to our "old" project and change the necessary values to adapt our project (such as project name, etc).

    I later noticed that if I had changed the whole descriptor file to begin with I would have bypassed problem #2...

    Finally, after all this, I was able to run my application sucessfully. Up until I tried to create a release build of my application, which brought me to Problem #4.

    Problem #4
    Because it was a silent error, problem #4 was the most annoying one (I later found that some silent errors can be detected by watching Flash Builder's log file). What happened was that I simply was unable to finish the release build process - I would click the "Finish" button, after all the "create release build" steps, but the popup window just wouldn't close and the ".air" file wouldn't be created.
    I found online that some people have had this problem due to having added a space inside some of the tag values in the descriptor file. This was not my problem but I looked into my "...-app.xml" file and found out that I was defining the app's icon image for only 4 of the 6 available sizes (in flex 3 we just needed to define 4 icon images while in flex 4 we must define it in 6 sizes). Apparently you are required to define the icon's image in all sizes.
    After commenting the <icon> tag of my descriptor file (I didn't have the time for creating the new required images at the time), I was able to successfully create a release build of my app.

    It took me a couple of hours to migrate my project (not counting on migrating all mx components to the new Spark components). Perhaps if I had tried to have a better understanding of the whole migration process beforehand it would have saved me some trouble, but it was a time vs effort decision.
    Now let's see if the new sdks were worth it ;)

    Here are some more references I found useful:

      Jun 16, 2011

      Flash Builder - AIR SDK error

      Launch Failed
      Cannot run program "/Applications/Adobe Flash Builder 4/sdks/3.5.0_AIR_2.5/bin/adl": error=13, Permission denied

      After a couple of hours stuck with this error while trying to build by Flex project in MacOS, I finally got it... The AIR sdk is different for each OS. And I was using a merged flex/air sdk I had from my Windows projects... Duh!

      So the solution is, download the AIR sdk that matches your OS and overlay it with the Flex sdk you are using. In your project, change the compiler settings to your new sdk (Project > Properties > Flex Compiler) "et voilá"!