UIComponent's width and height have no effect on Sprite

Posted by flexwheel on Stack Overflow See other posts from Stack Overflow or by flexwheel
Published on 2009-10-23T07:41:47Z Indexed on 2010/03/30 11:03 UTC
Read the original article Hit count: 224

Filed under:

Given this code:

var circle:Sprite = new Sprite();

circle.graphics.beginFill(0xFFCC00);
circle.graphics.drawCircle(0, 0, 20);

var uiComp:UIComponent = new UIComponent();

uiComp.x = 100;
uiComp.y = 100;

uiComp.measuredHeight = 0;
uiComp.measuredWidth = 0;

uiComp.addChild(circle);

addChild(uiComp);

Why does changing the width and height of uiComp not affect the Sprite? Wouldn't UIComponent provide Sprite with a Graphics object, which limits that area where Sprite can draw?

© Stack Overflow or respective owner

Related posts about flex