Friday, March 13, 2009

Adobe AIR Error 104 and 105 FileType

I have discovered that most AIR 'Build Project' errors are related to a malformed yourapp-app.xml file. Such is the case with the 105 Error of the FileType variety.

I created an AIR app that would support my own File Type extension. In the fileType's 'name' node, I put 'My Custom App'. Seemed reasonable since the template comments stated 'The name that the system displays for the registered file type. Required.'

Turns out that the 'name' need to be space-free and separated by dots:
My.Custom.App
In the case of the 104 Error, I uncommented the 'contentType' and entered the mime type (which was text/xml in my case).

<contenttype>text/xml</contenttype>


Hope this saves someone some time and agravation.




Wednesday, November 19, 2008

Nice MVC Sample Application

For those of you yearning to grasp the MVC model, I ran across an excellent article by Greg Lafrance in the Flex Cookbook. It does a fantastic job of presenting the model in a sample application:

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=11246

Enjoy, and thanks, Greg.

Thursday, June 5, 2008

Moving From Flash Into Flex

The adoption rate of Flex is blistering. As it turns out, just because you Flash doesn't mean you'll Flex (without a lot of work, that is). There a basically two factions of developers that are transitioning to Flex:
  1. 'Java-like' Programmers - comfortable with OOP, Event Models, Design Patterns and Frameworks that need a fairly limited ramp-up time to understand the Flex Framework, syntax, and mixing MXML with ActionScript.
  2. Flash Developers - Timeline centric, procedural programmers that struggle with Event-based, OOP structured applications.

This blog is dedicated to the later. There are thousands upon thousands of Flash Designer/Developers that resonate with one or more of the following descriptions:

  • Flash Designer/Developer very comfortable with the 'timeline'
  • Self taught with no formal IT schooling
  • Strong desire to move to Flex
  • Built (or attempted to build) a small Flex app or so
  • Built Procedural RIA Applications and dealt with the code 'ripple' effect
  • Worked hard to make the leap from AS1 to AS2
  • Working harder to make the mental leap from Procedural Programming to OOP/Framework design

If you can identify with any of these descriptions, then this is the place for you to present your challenges and have them addressed by others who have experienced the same and found ways to overcome.

Flex Is ActionScript
A Flex Application is compiled into a .swf. All the mxml in a Flex app is converted by the Flex Builder/SDK into ActionScript code. You can build some pretty cool apps very quickly with mxml and minimal ActionScript, but before long you'll find that you'll need an above average understanding of ActionScript in order to build the 'really cool' and 'really big' apps and still maintain your sanity.

The 'Right' Way
If there is one thing that I learning in my transition from Flash to Flex, is that there is no silver bullet - no one "right way" to design an application that improves reuse, grows gracefully, embraces de-coupling, and eliminates code clutter. There are some great programmers that have developed some amazing applications that do not strictly adhere to a specific framework. The size of your application, the speed in which it needs to built, the amount of maintenance required, and the size of your team will determine, for the most part, how you will fashion your framework. But the most important factors are that the app works well for the user and the code makes sense to you and those on your team - even when you go back and look at the code 3 months later.

Managing Expectations
In your quest to transition from Flash Into Flex, it's important to manage your expectations. Don't expect to jump directly from Procedural Programming to MVC or Cairngorm. Take baby steps. Start out taking one of your current apps and convert portions of it to a Class structure - one block of code at a time and test regularly. Then move onto understanding perhaps the M (Model) of MVC framework. Take one of your current applications and separate out the application's data into a Singleton Model Class that's accessible to the entire application. Make your learning incremental rather than quantum.

Required Reading
If you're starting fresh with little to no knowledge of OOP, I highly suggest Colin Mook's, Essential ActionScript 3.0. Take a weekend, bury yourself in a room, a coffee shop, or a mountain cabin and consume the thing! It will lay a great foundation for much that you'll need to know to build structured Flex Applications. It'll serve as a great resource as well.

Of the dozen or so Flex books I've read, I recommend Jeff Tapper's, Adobe Flex 3 - Training from the Source. It uses a Shopping Cart, Inventory Manager and an Executive Dashboard to illustrate the practical application of large portion of Flex concepts and tools. It's a 'cover-to-cover' type book that you find hard to put down until you get to the index.

I'll post code samples from time-to-time to help with your transition. I encourage others to do the same.

Until next time,

Jeff Boothe