Thanks for the help on this everyone.  I'll do some testing.

Brandon


----- Original Message ----
From: Gordon Smith <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Tuesday, July 1, 2008 9:23:42 PM
Subject: RE: [flexcoders] Sizing Components Inside Custom UIComponents


If you were extending a Container like VBox,
its updateDisplayList( ) implementation would call setActualSize( ) on the
children, taking their percentWidth and percentHeight into account. But when
you extend UIComponent, you take on the responsibility for sizing your
children.
 
Gordon Smith
Adobe Flex SDK Team
 

________________________________
 
From:[EMAIL PROTECTED] ups.com [mailto: [EMAIL PROTECTED] ups.com ] On Behalf 
Of  Alex Harui
Sent: Tuesday, July 01, 2008 4:40
PM
To: [EMAIL PROTECTED] ups.com
Subject: RE: [flexcoders] Sizing
Components Inside Custom UIComponents
 
Parents size their children in Flex.  You have to call
setActualSize on your children.
 

________________________________
 
From:[EMAIL PROTECTED] ups.com 
[mailto: [EMAIL PROTECTED] ups.com ] On Behalf Of krakowskyb
Sent: Tuesday, July 01, 2008 7:44
AM
To: [EMAIL PROTECTED] ups.com
Subject: [flexcoders] Sizing
Components Inside Custom UIComponents
 
I'm
pretty new to Flex. I've created some custom components by
extending UIComponent. I've implemented createChildren,
commitProperties, measure, and updateDisplayList. I can resize the
custom UIComponents using any number of methods:
constraints, CSS, etc. They resize no problem. But if I try to size
a child of that custom component, no width or height is assigned,
unless I use an explicit setActualSize.

For example:
My custom component (Content) has been added to a canvas. The
component is sized using width and height properties:

var content:Content = new Content;
content.width = 800;
content.height = 800;
addChild(content) ;

In content, in createChildren, I create an instance of the Image
component.

var container:Image = new Image;
container.scaleCont ent = false;
addChild(container) ;

I try to do this:
container.percentWi dth = 100;
container.percentHe ight = 100;

But nothing.

I can only seem to resize this inside updateDisplayList like so:
container.setActual Size(unscaledWid th, unscaledHeight) ;

Thanks,
Brandon


    


      

Reply via email to