tags:

views:

91

answers:

3

[Flex 4] Float left or right in layouts or containers? i have a main container, that is dynamic, 100% width, and in it there are 3 components. one should be floating to left, to right and the other will be centered. how do i do that?

+1  A: 

What do you mean by float? Is there any reason a group with a HorizontalLayout won't work?

<s:group layout="{new HorizontalLayout()}" width="100%>
 <container1>
 <container2>
 <container2>
</s:group>
www.Flextras.com
float just like styles for html divs.<s:group layout="{new HorizontalLayout()}" width="100%> <container1/> <container2/> <container3/></s:group>the c1 must be floating to leftthe c3 must be floating to rightand c2 must be in the middle
Totty
If memory serves me, doesn't the HTML Float allow for other "components" such as text to wrap around the floated component? IF so, nothing like that exists in Flex. You'd have to build it custom
www.Flextras.com
+1  A: 

Add your 3 components to an HGroup (spark) or an HBox (halo). If you want dividers that allow your components to be resized, you can use an HDividedBox. Hope that helps.

Edit: Here's a code example based on your comment:

<s:HGroup width="100%">
    <s:Panel id="fixedPanel1" width="150"/>
    <s:Panel id="variablePanel" width="100%"/>
    <s:Panel id="fixedPanel2" width="150"/>
</s:HGroup>

Is this what your are looking for?

Wade Mueller
its like this horizontally:|<-fix->|<-----var----->|<-fix->||<---------windows size-------->|fix = fixed size componentvar = variable size component
Totty
A: 

it was quite a stupid question solution:

It's this quite good?

Totty