THE PASZ.COM BLOG

Thursday, June 21, 2007

OmniGraffle, Where Have You Been All My Life?

It's not often one opens an application and immediately falls in love with it. Finally having decided that I need to mhttp://www.blogger.com/img/gl.link.gifove on from GModeler, I started searching for a solid UML diagramming tool -- preferably a free one. Though OmniGraffle is not free, after playing around with it for less than an hour, I plunked down almost $150 on the professional version without hesitation. Not a bad price when you consider that many UML tools are going for twice that much. (New Egg had the best price, by the way.)

The feature that first caught my attention was the ability to draw curved and orthogonal arrows between objects as effortlessly as drawing simple straight lines. As you drag objects around, the curved lines stay connected, and adjust themselves accordingly. As I dug deeper, I realized what a rich and flexible, diagramming tool it was. But don't take my word for it. Go to Graffletopia and check out the multitude of unique "stencils" people have come up with. OmniGraffle is for the Mac only -- and indeed the UI is very mac-like -- so if you're a Windows user, I guess you're stuck with Visio.

Its major limitation for me is that OmniGraffle can't generate stub code for you based on your diagram. Its focus is more toward general diagramming, rather than specifically for coding. But my experience with code generators has never been so great, and I usually end up writing the stubs out manually anyway.

Oh, and here is a great reference for getting started with UML.

Sunday, June 17, 2007

Using FlexBuilder to Program for Flash CS3

This is probably completely obvious to some people, but there's a scarcity of information out there about Flash/Flex workflow, so I thought I'd post.

Here's the scenario:
You've been hired to work with a design company that only uses the Flash CS3; they have no interest in learning Flex. However, you don't want to program in Flash CS3 or some other text editor because you're comfortable with all the advanced features of FlexBuilder. You need to write code that can be compiled in both FlexBuilder and Flash CS3.

Fortunately this is easy to do:
In Flex create a new ActionScript Project with a Main class that extends Sprite. Create a new FLA in the same folder as your "Main.as" file. In Flash CS3, import and instantiate Main, and then call addChild() to attach the Main instance to your timeline. Here's the AS3 code for the first frame:


import Main;

var m: Main = new Main();
this.addChild(m);


Now you can publish your SWF from either FlexBuilder or Flash CS3!