Category Archives: AIR

Don’t cast an UncaughtErrorEvent error

I just found this out the hard way, but you shouldn’t cast the error property of an UncaughtErrorEvent. I was doing the following in my uncaught error event handler:

1
2
3
4
5
6
7
8
9
private function onUncaughtErrorEvent(event:UncaughtErrorEvent):void {
	event.preventDefault();
	event.stopImmediatePropagation();
	if(event.error is Error) {
		log(Error(event.error).getStackTrace());
	}else if (event.error is ErrorEvent) {
		log(ErrorEvent(event.error).text);
	}
}

The problem with this is that it returns your uncaught error event handler as the last step when you call getStackTrace(). But changing your code a little will give you the real source of your error. Maybe everyone else knew this already, but I’m logging it here on my blog so I don’t forget.

1
2
3
4
5
6
7
8
9
private function onUncaughtErrorEvent(event:UncaughtErrorEvent):void {
	event.preventDefault();
	event.stopImmediatePropagation();
	if(event.error is Error) {
		log((event.error as Error).getStackTrace());
	}else if (event.error is ErrorEvent) {
		log(ErrorEvent(event.error).text);
	}
}

AIR Development for Blackberry Playbook

AIR for PlaybookI took some time to get familar with AIR development on the Blackberry Playbook. Overall it was pretty easy to get started but I did run into a few hurdles that I had to overcome to get the SDK and Simulator installed on Windows 7 64-Bit.

64-Bit Installation
In order to get the Blackberry tablet SDK and Simulator installed on Windows 7 64-Bit you must modify the installer to use a 32-bit Java installation. Luckily the support forums for AIR on Playbook is actually really good, you can see the installation tip here: Windows 7 64-bit Installation Workaround.

Debug Launch Configurations
The other issue I had was getting the Debug Launch Configurations to show up. Turns out after you install the SDK you need to run Flash Builder as and Administrator for the first time. This will complete the installation and the debug configurations displayed correctly.

Application development for PlayBook
Webcast series on AIR for Playbook Development
Free PlayBook Promotion

MN.swf Camp 2009 Call for Speakers

Yes, we’re going to do it again! MN.swf Camp was such a huge success in 2008 that we’ve decided to make it an annual event. It will be held at the Library again this year on Monday, April 6, 2009.

We’re currently looking for people interested in speaking. If this is you, please go to the MN.swf Camp web site and fill out our speaker form. You don’t need to submit your session topics yet. We’ll be holding an orientation meeting for all interested speakers. After that meeting you will have a couple weeks to submit your final topic ideas and selections will be made.

Peer-to-peer Communication With Flash Player 10

You probably didn’t notice that Flash Player 10 (and AIR 1.5) shipped with a new protocol for p2p (peer-to-peer) communication. The RTMFP (Real-Time Media Flow Protocol) is a new protocol that supports direct connections between two endpoints.

What is the benefit of p2p communication? This will lower the barrier to entry for people to create real-time applications in Flash Player and AIR. No more bandwidth and server management expenses. The RTMFP protocol will also be a higher quality connection since it is over UDP and not TCP like the RTMP (Real-Time Messaging Protocol) used by Flash Media Server. RTMFP will re-establish a connection if there is a brief outage and maintain a session even if the client’s IP address changes.

This new protocol could be used for a number of applications like: text chat, VoIP conversations, video chat or multi-player games/applications.

Adobe announced Stratus the week. The is a hosted rendezvous service that allows two endpoints to establish a p2p connection. Once the connection is established the service is no longer used to send the data between endpoints. Stratus is currently in beta, but is not yet available for developers to start playing with it.

You can see a few of the RTFMP details in the ActionScript 3 Language Reference (see NetConnection).

Object Relational Mapping in AIR and SQLite

When I first started looking at AIR and SQLite I thought to myself, “someone should write an object relational mapping framework to map objects to and from SQLite.” Well someone did. FlexORM handles mapping of relational objects to and from SQLite and eliminates all the messy code for doing this manually. I can’t wait to use this on my next AIR project. Thanks to Nate Chrysler for pointing this out to me.

AIR Distribution Kit

Tomorrow at FlashBelt I’ll be giving a presentation on Installation and Distribution Strategies in AIR. Since AIR applications are built using web technologies like JavaScript and ActionScript, many of the AIR users aren’t used to thinking about the installation and distribution strategies that desktop applications require. My presentation will cover a couple of these issues and show some sample solutions to these problems.

I’ll also be announcing the AIR Distribution Kit open-source project. This is a ActionScript 3 library for creating update functionality within AIR applications and for creating custom browser-based install applications (otherwise known as install badges). You can see more information about this project on my labs page. I just started this project, so there might be some bugs. Check it out and let me know what you think. Please let me know if you see anything you wish working differently or what features you’d like to see added in the future. If you’re interested in assisting with the development, please contact me.

Speaking at FlashBelt again this year

FlashBeltI’ll be speaking at FlashBelt again for the fourth straight year in June. I’ve spoken at this conference every year since I moved to Minneapolis in 2005. It’s a great conference that brings in both local and national attendees. My session is titled Distribution and Installation Strategies for AIR and will cover the following:

Flash and Flex developers have been spoiled by the fact that most of our applications are distributed over the internet through the browser and Flash Player. We didn’t have to worry about installation or updates within an application. This session will walk you through the process of building a custom badge using Flex that handles the installation, update and launch of your AIR application from within a browser. We’ll also look at how to implement an update feature within your Flex AIR application so your users can always have the most recent version of your application.