Author Archive

MigrAIRable Library Added to Google Code

Monday, November 17th, 2008 by Greg Jastrab

I created a Google Code repository for my winning submission to the Adobe AIR Cookbook Cook-off. The MigrAIRable library contains the source, an ANT file to create the SWC, and an example tree to demonstrate how to use it.

If you haven’t read about MigrAIRable yet, it is a solution to allow your serialized data structures to have migrations, so that adding new fields to later versions to your class will not break your serialization when reading older versions of the data.

If you’re at MAX this week, come checkout the session Inside the Adobe AIR Cook-off: The Best Show Off Their Winning Chops where I, along with the two runner-ups, will be panelists.

Presenting an Intro to Flex at Refresh Baltimore Tonight

Wednesday, November 12th, 2008 by Greg Jastrab

I’ll be presenting an introduction to Flex tonight at Refresh Baltimore. If you’ve been wondering what Flex is and have been meaning to look into it, this presentation will be right up your alley.

The presentation slides and code will be posted at http://www.smartlogicsolutions.com/wiki/Intro_to_Flex after the presentation.

RSVP at http://www.localist.com/event/6229 if you can make it.

I Won the AIR Cook-off

Wednesday, October 29th, 2008 by Greg Jastrab

I was waiting to post this until the results were announced which they were today. O’Reilly just posted the winners of the Adobe AIR Cook-off and I’m pleased to say I won the grand prize!

My recipe was Migrating Serialization Changes in AIR. Thanks to anyone who voted for it.

I have a follow-up recipe I haven’t gotten to write up yet, but I’ll try to get it up in the next week. It will provide a solution to add the marker which is required for this serialization to work to the front of your structures if you already have files being serialized in an existing AIR application and you want to start taking advantage of this migration technique.

Advanced CSS in Flex 4 - ID and Descendant Selectors

Tuesday, October 21st, 2008 by Greg Jastrab

A few days ago one of the commit messages in the Gumbo trunk mentioned some work for advanced CSS was beginning. I tried to create an example of using a descendant selector as well as an ID selector, but neither worked.

Tonight, another commit message said that this was now in place by default (I guess it would have worked earlier, but I needed to be specify a compiler argument). But now, after rebuilding the latest checkout of Gumbo you should now be able to compile the following example to see the advanced CSS selectors working. Below is the SWF (you’ll need Flash Player 10 to view it) and the code follows:

(more…)

Using SWFObject to Seamlessly Upgrade to Flash Player 10

Wednesday, October 15th, 2008 by Greg Jastrab

If you haven’t heard that Flash Player 10 was officially released, then get out of the hole you’ve been living in and go get Flash Player 10!

When you’re ready to deploy your first Flash Player 10 SWF, you’ll want to ensure your users have the latest Flash Player so they can actually view your content! Why not make it as easy as possible for them to upgrade and use SWFObject to embed your SWF and seamlessly upgrade older version of the Flash Player up to 10?

Let’s say you’re embedding a SWF called MyFlashPlayer10.swf. Using the dynamic publishing method there are just 3 simple steps to follow to get your SWF embedded with SWFObject…

(more…)

New Flex 4 Theme and Class Renaming

Wednesday, October 8th, 2008 by Greg Jastrab

A few times a day I update my subversion checkout of the Gumbo trunk. Last night I noticed a major overhaul which renamed all the Flex 4 classes, repackaged them into the mx package instead of flex. The new classes are now all (at least temporarily) prefixed with Fx, so if you are trying to compile your previously working Flex 4 code against the up-to-date SDK and suddenly see the following error:

Error: Could not resolve <Application> to a component implementation.

your issue will be resolved by changing Application to FxApplication. You’ll need to do the same for most of the other Flex 4 controls (Group, VGroup, and HGroup are exceptions that don’t need to be prefixed with Fx).

Spark Theme

You may also notice the new spark folder added in the skins directory. Below is an example application showing what these new skins look like for some of the Gumbo components:
(more…)

Rotate Effect and Non Embedded Fonts in Flex 4

Thursday, September 25th, 2008 by Greg Jastrab

One big improvement in Flash Player 10 is that fonts no longer need to be embedded in order to rotate text or alter it’s alpha. Below is a simple example demonstrating both of these features by using the Rotate and Fade effects in Flex 4.

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

Check out how simple the code is below!

(more…)

Migrating Serialization Changes Within an AIR Application

Thursday, September 11th, 2008 by Greg Jastrab

I just submitted my entry to the AIR Cookbook for the AIR Cookbook Cook-off.

It solves the problem of having your AIR application store an IExternalizable class on disk but then later adding more fields to that class. How would you read the old version of the class without encountering a runtime error if you tried to read the new field that wasn’t present in the older serialization?

Go check it out the cookbook entry to find out how to do this and please rate the article!

Serialization Error/Bug When Using a ByteArray and readObject in an IExternalizable Class?

Wednesday, August 27th, 2008 by Greg Jastrab

I’ve encountered some odd behavior that I would have expected to work when calling readObject() to de-serialize an array of anonymous objects. If anyone knows what’s going on here, please enlighten me. I’ve also filed a bug on Adobe’s bug tracking system if anyone wants to follow the progress at Adobe’s end.

I’m trying to read all of the bytes in the readExternal() function of a class implementing IExternalizable, so that I may use the position property to move back in stream in case I need to do so. The problem only seems to occur if I am trying to de-serialize an Array of anonymous objects. If I put plain old Strings in the Array it will work fine. I find this odd since I would expect

public function readExternal(input:IDataInput):void {
  var arr:Array = input.readObject() as Array;
}

to have the exact same behavior as:

public function readExternal(input:IDataInput):void {
  var ba:ByteArray = new ByteArray(); 
  var inputBytes:uint = input.bytesAvailable;
  input.readBytes(ba);
  var baBytes:uint = ba.bytesAvailable;
  var arr:Array = ba.readObject() as Array;
  trace("inputBytes == baBytes ?= " + (inputBytes == baBytes)); // traces "inputBytes == baBytes ?= true
}

AIR installer and code attached below… (more…)

Recreating Ely’s Flex 4 List Component Series: Part 3 - Adding Transitions

Saturday, August 23rd, 2008 by Greg Jastrab

In Part 2 we added hovered and selected states to the ItemRenderer for the list items. In this part we’ll add some transitions to make the list look more like an Accordion. Since screenshots won’t do the example justice this time, I’ll show a screencast I made demonstrating the result first:

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)
(Sorry for the embed being cutoff, still figuring out the params to this word press plugin. Click through for the full embed on its own page.)

Keep reading for the source…

(more…)