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

**URL:** https://forum.kirupa.com/t/help-sprite-addchild-numericstepper-resizes-sprite-to-100x100/261387
**Category:** flash
**Created:** [May 27, 2008, 7:26am UTC](https://forum.kirupa.com/t/help-sprite-addchild-numericstepper-resizes-sprite-to-100x100/261387 "2008-05-27T07:26:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cs130](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@cs130](https://forum.kirupa.com/u/cs130)
#### Post date: [May 27, 2008, 7:26am UTC](https://forum.kirupa.com/t/help-sprite-addchild-numericstepper-resizes-sprite-to-100x100/261387/1 "2008-05-27T07:26:41Z")

</div>

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:

> **[kirupaForum](https://forum.kirupa.com)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

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

Thanks!

---

<div class="post-metadata">

### Author: ![cs130](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@cs130](https://forum.kirupa.com/u/cs130)
#### Post date: [May 27, 2008, 7:47am UTC](https://forum.kirupa.com/t/help-sprite-addchild-numericstepper-resizes-sprite-to-100x100/261387/2 "2008-05-27T07:47:20Z")

</div>

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!
