"air-2" Posts

Tip of the Day – Updating to Flash Builder 4.0.1

I recently posted about Building AIR 2 applications with Flash Builder 4.

There is now an update for Flash Builder 4 which downloads and installs the Adobe Flex 4.1 SDK. According to Renaun Erickson’s post, Flex 4.1 includes Flash Player 10.1 and AIR 2.0.

Now, if you’re like me and loathe the Adobe Updater… then you probably turned off the Adobe Updater notifications.

So here’s how to update Flash Builder to version 4.0.1 which includes the 4.1 SDK.

Go to Help > Search for Flash Builder Updates…

Help - Search for Flash Builder Updates...

This will launch the Adobe Application Manager and then proceed to update your software, including Flash Builder 4.

== UPDATE ==

If you don’t see a Flash Builder update available in Adobe Application Manager, you can download the standalone updater from Adobe.

Update Progress

Update Complete

Once the update is completed you can see Flash Builder is now at version 4.0.1.

Flash Builder 4.0.1 about screen

And you now have the option for Flex 4.1 as an installed Flex SDK. You can use Flex 4.1 to develop against Flash Player 10.1 and Adobe AIR 2.0.

4.1 is now avaliable

The WOPR running on Adobe AIR 2

I don’t know about you guys, but one of my favorite movies of all time is WarGames with Matthew Broderick.

If you haven’t seen it, Netflix has it available on instant watch… go now… watch it… I’ll wait.

Alright, awesome movie huh?!

One of the characters in the movie is Joshua, also known as the WOPR or War Operations Plan Response.

WOPR

With the release of Adobe AIR 2.0, Adobe has given us a new fun class to play with, ServerSocket.

The ServerSocket class allows code to act as a server for Transport Control Protocol (TCP) connections.

So I decided to combine my love of WarGames and the WOPR and create a WOPR emulator in Adobe AIR 2 that can be accessed using Telnet.

How to use the WOPR

Install using the badge installer here:

Get Adobe Flash player

When you open the WOPR application it attempts to connect to 127.0.0.1 (localhost) on port 9999. If the console doesn’t show an error, you’re good to go.

On the Mac, open up Terminal (Applications > Utilities > Terminal)… if you’re on the PC, you should go and download PuTTY.

Once you’re in Terminal enter this command (if you change to a different port number, use that number instead of 9999):

telnet 127.0.0.1 9999

Once you’re in, you can have fun with Joshua. For example:

LOGON: Joshua
GREETINGS PROFESSOR FALKEN.
Hello
HOW ARE YOU FEELING TODAY?
I am fine. How are you?
EXCELLENT. IT'S BEEN A LONG TIME.
CAN YOU EXPLAIN THE REMOVAL OF YOUR USER ACCOUNT ON 6/23/73?
People sometimes make mistakes
YES THEY DO. SHALL WE PLAY A GAME?
Love to. How about Global Thermonuclear War
WOULDN'T YOU PREFER A GOOD GAME OF CHESS?
Later. Let's play Global Thermonuclear War
FINE

It’s a lot of fun! I haven’t implemented any of the games yet… but this shows what kind of cool stuff you can write with the new Adobe AIR 2 features.

Download Full Source Code here.

Enjoy!

Tip of the Day – Building AIR 2 applications with Flash Builder 4

:: Update ::

This process has gotten much easier, you can now use software update to get AIR 2 as well as Flash Player 10.1 in Flash Builder… check out this post.


Adobe AIR 2 and Flash Player 10.1 were released on June 10th, 2010. It’s an exciting time. This weekend I decided to do some development on AIR 2 to try out some of the new features.

On the Adobe AIR Team blog’s post they mention that the free standalone download of the AIR 2 SDK will be available on Tuesday, June 15th… but I wanted to play with the SDK today.

So I went over to the Adobe AIR labs page and downloaded the AIR 2 Release Candidate SDK which is –> here.

You can download the released SDK from –> here

After downloading the Adobe AIR 2 SDK, I followed the directions on the release notes which explained how to overlay the AIR 2 SDK with my current version of Flex 4.

I’m on a mac, here are the commands I used in Terminal:

cd /Applications/Adobe\ Flash\ Builder\ 4/sdks/
ls
cp -r 4.0.0 4.0.0AIR2
ls
cp ~/Downloads/air2_rc1_sdk_mac_051110.tbz2 4.0.0AIR2
cd 4.0.0AIR2
tar jxvf air2_rc1_sdk_mac_051110.tbz2

I then added a new SDK to the installed SDK’s inside of Flash Builder:
Installed SDK's in Flash Builder 4

Now, I already had an Adobe AIR application project set up, and I switched over to the new SDK the I installed:
Switched over to Flex 4.0 (AIR 2)

However, when I tried to run my AIR application, I ran into this error:

VerifyError: Error #1014: Class IIMEClient could not be found.
 
	at flash.display::MovieClip/nextFrame()
	at mx.managers::SystemManager/deferredNextFrame()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:267]
	at mx.managers::SystemManager/preloader_preloaderDocFrameReadyHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2460]
	at flash.events::EventDispatcher/dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at mx.preloaders::Preloader/timerHandler()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\preloaders\Preloader.as:488]
	at flash.utils::Timer/_timerDispatch()
	at flash.utils::Timer/tick()

After doing a bit of research I found out that my Adobe AIR project’s application descriptor file wasn’t using the correct namespace for the AIR 2.0 SDK. According to the Adobe AIR 2 Release Notes:

You must update your application descriptor file to the 2.0 namespace in order to access the new AIR 2 APIs and behavior. If your application does not require the new AIR 2 APIs and behavior, you are not required to update the namespace from 1.x based namespace. To update the namespace, change the xmlns attribute in your application descriptor to: http://ns.adobe.com/air/application/2.0

Sure enough, I hadn’t changed my namespace from AIR 1.5.3 to AIR 2.

I made the change in the descriptor file, and now everything works perfectly.