This content has been marked as final. Show 2 replies
Hi -- I'm not exactly sure what you are asking, perhaps you could rephrase your questoin, and include some *small* code examples? I'll take a stab at it though :)
percentWidth is a value on child UIComponents like yours, but is _used_ by the parent (e.g. containers) for layout and sizing of that child. If your component is not in a container like an HBox, then the value is unused.
If your component is inside of a container, and you are saying that you set the percentWidth on your component, and it is not doing anything, then I might suspect that:
* You are not reading the width/height of your component when doing your drawing -- look at width/height, unscaledWidth/Height, and measuredWidth/Height.
* You're giving it improper values -- it takes Numbers from 0 to 100
* You're setting the width or explicitWidth elsewhere, which makes the percentWidth meaningless.
Hope some of that helps,
I have create a UIComponent RectObj wiht a draw( ) method.
A rectange will be drawn inside the draw( ) method. I put this RectObj inside a container Convas.
How can I make the width & height of RectObj be relative to the Convas..
i want to make it as:
var rect: RectObj = new RectObj();
rect.percentWidth = 100;
rect.percentHeight = 100;
var con : Convas = new Convas();