Hi - I'm trying to verically align a swatch and a label in an hbox by setting the verticalcenter of the swatch and then setting the vertical center of the label to the same value -- not working. Any ideas on why or a better approach I could take? below is code
Thanks
Pete
...... var sr:SimpleRenderer=SimpleRenderer(aRenderer); swatch=sr.symbol.createSwatch(50, 50); swatch.verticalCenter=25; aLabel.verticalCenter=swatch.verticalCenter; .....
Robert - the verticalAlign property is not recognized in my intellisense. When I try to use it I get an Error: Access of possibly undefined property verticalAlign through a reference with a static type mx:containers:hbox
Complies and runs but has no effect on the alignment -- I think it has something to do with the swatch -- if I add two labels they align vertically just fine
I shrunk the height of the swatch down to the hieght of the label -- not the best, but they do line up now -- fortunately all my legend items are points
Your only other option may be to use a group instead of an HBox, then specify the x, y. Using Group you could retain your original swatch size. Since you know the height difference between the swatch and the label you should be able to center them.