tags:

views:

86

answers:

1

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?

A: 

As I said in the other thread, use unscaledWidth and unscaledHeight as the bounds for drawing.

Amarghosh