# Textfields overlapping

**URL:** <https://forum.kirupa.com/t/textfields-overlapping/257555>\
**Category:** flash\
**Created:** [April 15, 2008, 9:42am UTC](https://forum.kirupa.com/t/textfields-overlapping/257555 "2008-04-15T09:42:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethernal](https://avatars.discourse-cdn.com/v4/letter/e/e47c2d/32.png) [@ethernal](https://forum.kirupa.com/u/ethernal)\
**Post date:** [April 15, 2008, 9:42am UTC](https://forum.kirupa.com/t/textfields-overlapping/257555/1 "2008-04-15T09:42:43Z")

</div>

Well I am trying to make a menu.

This menu has 4 options, and each of them consists in aTextfield inside a Sprite. The Textfield has a custom TextFormat.

The problem is that each option is overlapped partially by the next one, so when I click on the bottom part of it, the one who reacts is the lower option.

See pic (border of textfield set to 1 to see the area):

![](http://img224.imageshack.us/img224/7981/overlappinggj8.jpg)

How can avoid this?

Textfield and sprite settings:  
ActionScript Code:

```
 [FONT=Courier New][LEFT]mouseChildren = [COLOR=#000000] **false** [/COLOR];
        buttonMode = [COLOR=#000000] **true** [/COLOR];
        _textfield = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]TextField[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
        addChild[COLOR=#000000]([/COLOR]_textfield[COLOR=#000000])[/COLOR];
        _textfield.[COLOR=#0000ff]text[/COLOR] = [COLOR=#0000ff]_name[/COLOR];
        _textfield.[COLOR=#0000ff]border[/COLOR] = [COLOR=#000000] **true** [/COLOR];
                    
        addEventListener[COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]MOUSE_OVER[/COLOR], onMouseOver[COLOR=#000000])[/COLOR];
        addEventListener[COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]MOUSE_OUT[/COLOR], onMouseOut[COLOR=#000000])[/COLOR];
        addEventListener[COLOR=#000000]([/COLOR]MouseEvent.[COLOR=#000080]CLICK[/COLOR], onClick[COLOR=#000000])[/COLOR];
        
        _textfield.[COLOR=#0000ff]selectable[/COLOR] = [COLOR=#000000] **false** [/COLOR];
        _textfield.[COLOR=#000080]defaultTextFormat[/COLOR] = _fmt;
        _textfield.[COLOR=#0000ff]setTextFormat[/COLOR][COLOR=#000000]([/COLOR]_fmt[COLOR=#000000])[/COLOR];
        _textfield.[COLOR=#0000ff]autoSize[/COLOR] = TextFieldAutoSize.[COLOR=#0000ff]LEFT[/COLOR];

```

[/LEFT]  
[/FONT]

The textformat code is (its inside a getter func):

```
 ActionScript Code:

 [FONT=Courier New][LEFT][COLOR=#000000] **var** [/COLOR] fmt:[COLOR=#0000ff]TextFormat[/COLOR] = [COLOR=#000000] **new** [/COLOR] [COLOR=#0000ff]TextFormat[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"Meta Normal Caps"[/COLOR], [COLOR=#000080]48[/COLOR], 0x00aeef[COLOR=#000000])[/COLOR];
        fmt.[COLOR=#000080]letterSpacing[/COLOR] = -[COLOR=#000080]5[/COLOR];
        fmt.[COLOR=#000080]kerning[/COLOR] = [COLOR=#000080]0[/COLOR];
        
        [COLOR=#0000ff]return[/COLOR] fmt;

```

[/LEFT]  
[/FONT]
