I've been trying to get the Flow.as code working in Flex 2...

I've discovered that layoutChildren() is now updateDisplayList() and
that the Container class is now under mx.core.

Can anybody point me in the right direction for something else that
might have changed? Or even if there is a new way to do this with the
new Flex 2 containers.

Thanks for your time,

Brian


--- In [email protected], Manish Jethani <[EMAIL PROTECTED]>
wrote:
>
> On 9/30/05, flexhansen <[EMAIL PROTECTED]> wrote:
> 
> > Is there an easy way to achieve mx:Tile behaviour but without the
> > tiles being of equal size?
> >
> > In other words I'm looking for something like the div-tag of plain old
> > html that wraps content to fit the width prop. instead of putting up
> > scrollbars.
> 
> You mean flow layout?
> 
> // Flow.as
> 
> /**
>  *  Implements flow layout for Flex.
>  */
> class Flow extends mx.containers.Container
> {
>   public function layoutChildren():Void
>   {
>     var vm:Object = getViewMetricsAndMargins();
> 
>     var lastX:Number = vm.left;
>     var lastY:Number = vm.top;
> 
>     var rowHeight:Number = 0;
> 
>     for (var i:Number = 0; i < numChildren; i++)
>     {
>       var child:Object = getChildAt(i);
> 
>       if (lastX + child.preferredWidth > layoutWidth - vm.right)
>       {
>         lastX = vm.left;
>         lastY += rowHeight;
>       }
> 
>       child.move(lastX, lastY);
> 
>       lastX += child.preferredWidth;
>       rowHeight = Math.max(rowHeight, child.preferredHeight);
>     }
> 
>     super.layoutChildren();
>   }
> }
> 
> You should also override the 'measure' method to enable the container
> to correctly measure itself.  The above code only does the job of
> laying out (which is okay if you're always specifying a width and
> height explicitly).
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/2pRQfA/bOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to