Getting width of Sprite with component inside it

Hello,

I’m not sure why I can’t get the width of a Sprite when it has components in it.

For example



var foo:Sprite = new Sprite();
addChild(foo);

var comboBox:ComboBox = new ComboBox();
comboBox.setSize (300, 30);

foo.addChild(comboBox);

trace(foo.width); // outputs 100 ???


I’m assuming the component possibly isn’t set before I’m trying to get the width? Doesn’t make sense though.

Thanks
D