2 Replies Latest reply on Jul 11, 2011 11:22 PM by kidelectric

    "Text wrapping" labels (or other elements) in a BorderContainer?

    kid electric

      Hello, I have been using Flex since Flex 2.0 but am new to the recommended Spark layout elements/containers/groups.


      Is there a way to get a Container to force internal elements to "wrap" (like text wrapping, ie. to automatically move down below if there is no space left in the container for them)...


      I know I could probably work a hack in which I measure the width of each element I am adding, keep a running tally to determine if there is width left in the BorderContainer, and move the element down to a new row (maybe I would need a new HGroup to do this?) accordingly, but I was wondering if there is a more straightforward or efficient way.


      In particular, I am adding a sequence of words as button-style labels (ie. labels with rollover and click events for each word), hence I cannot benefit from the auto-wrapping feature of a Text element, though I need my series to be constrained into a specific space similar to the Text display.  Can this be easily done using Container or Group/HGroup?