Hi there,
In Adobe Flex 3, I have an HBox containing an Image and a Label:
<mx:HBox width="240" verticalAlign="top" horizontalGap="8">
<mx:Image width="46" source="@Embed(source='/assets/blah.swf')"/>
<mx:Label text="Blah."/>
</mx:HBox>
My Goal is to align the top edge of the Image and the top edge of the Label (the top of capital characters within the Label, that is). However, no matter what properties and styles I fiddle with, a constant "padding" (in quotes because paddingTop is zero) of some 6 pixels remains above the Label, setting its top edge below the Image's. Does anyone know why?
Thanks, Simon
edit:
paddingTop is not doing the trick. I'm seeing the same behaviour on this:
<mx:HBox width="240" verticalAlign="top" paddingTop="0">
<mx:Canvas width="46" height="46" backgroundColor="red" paddingTop="0"/>
<mx:Label text="Blah." paddingTop="0"/>
</mx:HBox>
I also verified that there's no global stylesheet interfering with any of those classes.
edit 2:
From the mx.core.UITextField source code (Flex 3.2.0) which is used internally by Label, ll. 159:
/* The width and height of the TextField are 4 pixels greater than the textWidth and textHeight. */
and also
public function get measuredHeight():Number { (...) return textHeight + TEXT_HEIGHT_PADDING; (...) }
Then I set my Label's paddingTop to -4, and voilà, problem solved! It's not really a clean solution, though...