views:

395

answers:

1

I'm adding dynamically labels to hbox, and i need to remove all spaces between the text of 2 nearby labels

i did horizontalGap = 0 for Hbox padding left and right = 0 for labels

anything else i could do ?

or maybe some other component ?

here is the code

    <mx:HBox horizontalGap="0">
 <mx:Label text="wo" paddingLeft="0" paddingRight="0"/>
 <mx:Label text="rd" paddingLeft="0" paddingRight="0"/>
</mx:HBox>
+1  A: 

Why not use only one label and "dynamically" change its text property?

If you just don't want to do it like that, try using negative horizontalGap on the HBox until you get the desired effect, or paddingLeft negative on the second label. (horizontalGap would affect the layout of all the labels in the HBox)

bug-a-lot
because I'm using actually a flowbox and a label cannot stay on two lines, but thank you for your suggestion of negative horizontal gap, i did not knew that this is possible, i shall definitely try this
Omu
A label can't stay on two lines, true enough, but then, that's what the Text component is for. If you put a width value (either percentage or fixed) the Text component will adjust its weight based on the text that it contains.
bug-a-lot
thank you very much, the negative stuff worked really well; yes i know about the text component, the thing is that you cannot put smiley faces inside a text component :) but you can in a flowbox/hbox
Omu