# Need advice in managing a "header" textfield

**URL:** https://forum.kirupa.com/t/need-advice-in-managing-a-header-textfield/289627
**Category:** flash
**Created:** [June 2, 2009, 7:04pm UTC](https://forum.kirupa.com/t/need-advice-in-managing-a-header-textfield/289627 "2009-06-02T19:04:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dragonfly](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dragonfly](https://forum.kirupa.com/u/dragonfly)
#### Post date: [June 2, 2009, 7:04pm UTC](https://forum.kirupa.com/t/need-advice-in-managing-a-header-textfield/289627/1 "2009-06-02T19:04:32Z")

</div>

I’ve got a function, based on the Flash help files called configureHeader();

```auto

private function configureHeader():void {
            tfHeader = new TextField();
            tfHeader.autoSize = TextFieldAutoSize.LEFT;
            tfHeader.selectable = false;
            tfHeader.embedFonts = true;
            tfHeader.y = 20;
            
            var titleFormat:TextFormat = new TextFormat;
            titleFormat.color = 0xFFFFFF;
            titleFormat.font = myFont.fontName;
            titleFormat.size = 48;
            
            tfHeader.defaultTextFormat = titleFormat;
            addChild(tfHeader);
            trace(getChildIndex(tfHeader))
        }

```

The application is a multipage kiosk project. It starts with a homepage with no header, then a sub nav with the header, and then it goes one page deeper than that with the same header, but new text.

For the sub page function I call:

```auto

configureHeader();
tfHeader.text = title;
tfHeader.x = (stage.stageWidth/2) - (tfHeader.width/2);

```

For the sub-sub page I only call:

```auto

tfHeader.text = title;
tfHeader.x = (stage.stageWidth/2) - (tfHeader.width/2);

```

So as to only repopulate the header text. The question I have is that, when the user touches my “Back” button on the sub-sub page, I again call the function that loads the previously loaded sub page. That means I’m calling the configureHeader() function again… This appears to work the way I want it to, but I notice when tracing the childIndex of the tfHeader TextField that the index keeps increasing.

Will this cause issues? Whats happening to the previously added children? And what happens when/if that index number gets too high? Isn’t there a limit?

Please let me know if I need to worry about this and if so, is there a better way.

Thanks!
