# Adding a TextInput Component changes Sprite Height?

**URL:** <https://forum.kirupa.com/t/adding-a-textinput-component-changes-sprite-height/227509>\
**Category:** flash\
**Created:** [May 30, 2007, 10:28pm UTC](https://forum.kirupa.com/t/adding-a-textinput-component-changes-sprite-height/227509 "2007-05-30T22:28:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BradLee](https://avatars.discourse-cdn.com/v4/letter/b/5f9b8f/32.png) [@BradLee](https://forum.kirupa.com/u/BradLee)\
**Post date:** [May 30, 2007, 10:28pm UTC](https://forum.kirupa.com/t/adding-a-textinput-component-changes-sprite-height/227509/1 "2007-05-30T22:28:36Z")

</div>

I’ve come across a rather puzzling (to me anyway) problem. When I try to add a TextInput component to a sprite it changes the value of the sprite’s height variable to something odd.

For example…

```auto

package
{
    import flash.display.Sprite;
    import fl.controls.TextInput;
    
    public class InputBar extends Sprite
    {
        public function InputBar()
        {
            var tInput:TextInput = null;
            
            //Trace out the height - should trace ~50
            trace("Height Before: " + height);
            
            //Now add a componenet
            tInput = new TextInput();
            addChild(tInput);
            
            //Trace out the height of the component
            trace("Component Height: " + tInput.height);
            
            //Trace out the height again - should STILL trace ~50
            trace("Height After: " + height);
        }
    }
}

```

This outputs:

```auto

Height Before: 51
Component Height: 22
Height After: 100.5

```

Huh? Why is the height changing at all? Because the TextInput is smaller it should just sit on top and not affect the height at all. And even if it did… how the heck do you get 100.5?

Can anyone shed some light on this situation? Am I going crazy?
