Okay, here's the kludge I made to make it work.  It very much is a kludge,
but it seems to work.  I'd really like this to just work in the original
component, though.

package nes
{
 import mx.containers.Tile;
 import flash.display.DisplayObject;

 public class TileExt extends Tile
 {
   public var originalHeight:Number = NaN;

   override protected function updateDisplayList(unscaledWidth:Number,

unscaledHeight:Number):void
   {
       super.updateDisplayList(unscaledWidth, unscaledHeight);

       if (initialized)
       {
         if (isNaN(originalHeight))
           originalHeight = height;

         var lastChild:DisplayObject;
         var thisChild:DisplayObject;
         var rows:int = 1;
         for (var i:int = 0; i < numChildren; i++)
         {
           thisChild = getChildAt(i);
           if (lastChild && lastChild.x > thisChild.x)
             rows++;

           lastChild = thisChild;
         }

         height = originalHeight * rows;
       }
   }
 }
}


On 4/26/07, Pan Troglodytes <[EMAIL PROTECTED]> wrote:

Don't you hate it when you find someone asking your exact question but
there's no answer?  Even better, you find TWO people asking it.

I'm having this same problem and it's frustrating.  The whole point of the
Tile was to manage the layout for me and flow it on the window resizing.
Right now I'm experimenting with subclassing Tile and adding my own resize.
If anyone has already done this, I'd love to see your solution.

On 4/24/07, Alex <[EMAIL PROTECTED]> wrote:
>
>   I'm having exactly the same problem. The Tile component grows taller
> than expected. It seems to allocate height for an extra row when
> there's no need to do so :S
>
> Did you already find a solution to this?
>
> --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, joshua
> gatcke <[EMAIL PROTECTED]> wrote:
> >
> > I am trying to use a <mx:Tile> container to layout a set of
> > application icons. I have set the <tile> container to a width of
> 100%
> > and would like the icons to wrap to the line below if the browser
> is
> > smaller or resized. The problem I am having is that the icons in
> my
> > <tile> container are 60px tall and The <tile> container does not
> fit
> > the height to the content, it looks like the <tile> container is
> > double or triple the icon height, even when there is no need to
> wrap.
> > I have no width or maxWidth etc attributes on the <tile>
> container.
> > This is a real pain, I just want the tile container to fit the
> height
> > to the content.
> >
> > Thanks in advance for your help
> >
> > Joshua Gatcke
> > Design/ Development
> > [EMAIL PROTECTED]
> > P: 403.269.1020
> > C: 403.815.3265
> > ----------------------------------------------------------
> ----
> > -----------------------------------------------------
> > http://www.LaunchCMS.com - Simple intuitive content management
> > software for the web.
> > ----------------------------------------------------------
> ----
> > -----------------------------------------------------
> >
>
> >



--
Jason




--
Jason

Reply via email to