I had a similar question last week, and what I ended up doing, thanks to
some help on this list, was extending UIComponent and overriding some
methods, something like this:
package components
{
import mx.core.UIComponent;
import flash.geom.Rectangle;
public class MyComponent extends UIComponent
{
public var container:UIComponent;
public function MyComponent()
{
super();
}
override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
measuredWidth = unscaledWidth;
measuredHeight = unscaledHeight;
}
override protected function measure():void
{
var rect:Rectangle = getBounds(container);
measuredWidth = rect.width;
measuredHeight = rect.height;
}
}
Jason Merrill
Bank of America
GT&O L&LD Solutions Design & Development
eTools & Multimedia
Bank of America Flash Platform Developer Community
________________________________
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Daniel
Sent: Wednesday, January 23, 2008 4:18 PM
To: [email protected]
Subject: [flexcoders] Who to contain a UIComponent?
Hey guys...
I'm working on a component that extends from IUComponent. I need
to
set it as a child of a container, so that when the size of the
UIComponent changes scrollbars will appear in the container.
But Flex always draws the UIComponent on top of the container.
What container should I use?