Matt LeGrand is an accomplished user experience specialist with a primary focus on Adobe Flex and Air application development. Matt has been working with Flex since 2005 and Adobe Flash since 1999. His interest are in human computer interaction and interactive media research.
Continuing my rant about styles in the Adobe Flex world I'd like to review programmatic drawing of assets. Just for fun I'll be drawing jelly beans.
First up I'll take a stab at drawing one with the regular ole drawing api. This may sound odd to our Flex audience but a long long time ago in a land before degrafa or fxg flash developers just drew out lines, squares and jelly beans using the drawing api. The nice thing about being familiar with the drawing api is it will serve you well when you switch over to doing an Action Script only project.
Drawing out a quick Jelly Bean:
If this were a Flex project you might extend the UIComponent and override the updateDisplay function to measure out the size of the bean a little better. It'd also be smart to make this a little more dynamic by adjusting the colors based on a public color value.
I also wanted to compare drawing out a jelly bean in FXG. I won't post the Catalyst (http://labs.adobe.com/technologies/flashcatalyst/) generated code because it's over 11,000 lines of code. I'm guessing I should have optimized that a little bit.
Lastly, I don't want to overlook the simplest styling method of just importing an image:
source="@Embed('alagad/jellyBean.png')". So simple and yet so effective.
thank you for this tutorial
Posted By: sharedtut on Jan 21, 2010 at 11:52 PM