Archive for August, 2009

Adobe MAX Widget

See you there!

…from Ted’s Blog

Post to Twitter Tweet This Post

,

No Comments

Centering the Label Vertically in a FormItem

So you’re coding up some form items and the glorious designer is showing the label for the form item centered vertically, or, at the bottom.

centeredformlabel

Piece of cake says I and I start to look for the props to do so. Lo and behold, they don’t exist. WTF??

Google this and google that and no luck!!

Great, now what do I do?

Well, it’s kinda hacky, but it works.

I call this function on the creationComplete event of the FormItem:

private function centerLabel(evt:FlexEvent):void
{

var fi:FormItem = FormItem(evt.currentTarget) as FormItem;
var lbl:Label = fi.itemLabel as Label;
lbl.move( lbl.x, lbl.y + (lbl.height/2) );

}

Enjoy

Post to Twitter Tweet This Post

,

No Comments