HELP: sprite.addChild(NumericStepper) resizes sprite to 100x100

If anyone can help me with this, I would be extremely grateful. It’s driving me insane.

If I run this code:

var mySprite:Sprite = new Sprite();
trace(“mySprite 1:”, mySprite.width, mySprite.height);
numericStepper = new NumericStepper();
trace(“numericStepper 2:”, numericStepper.width, numericStepper.height);
mySprite.addChild(numericStepper);
trace(“mySprite 3:”, mySprite.width, mySprite.height);

I expect this output:

mySprite 1: 0 0
numericStepper 2: 80 22
mySprite 3: 80 22

But I get this output:

mySprite 1: 0 0
numericStepper 2: 80 22
mySprite 3: 100 100

If instead I do this:

mySprite = new Sprite();
trace(“mySprite 1:”, mySprite.width, mySprite.height);
numericStepper = new NumericStepper();
trace(“numericStepper 2:”, numericStepper.width, numericStepper.height);
mySprite.addChild(numericStepper);
trace(“mySprite 3:”, mySprite.width, mySprite.height);
mySprite.width = 80;
mySprite.height = 22;

Then the numericStepper is drawn as if it is squished to 20% its normal height.
If I pre-set mySprite width and height before adding the numericstepper, the trace output is 0,0 after adding it and it is not displayed at all.

Is there some way I can make the sprite only adjust to correctly fit the numericStepper OR resize it afterwards without distorting the numericStepper component?

As I was typing this, I came across this post:

Can anyone help me modify that solution for a numeric stepper?

Thanks!

Ok, problem solved. Looking through the other solution and tracing several outputs, I settled on this:

var tInput:TextInput = numericStepper.getChildAt(2) as TextInput;
tInput.textField.height = 22;

Hopefully someone finds this useful. Sometimes (actually, very often) I wish we had pure-actionscript versions of all components!