# Null object reference text help!

**URL:** <https://forum.kirupa.com/t/null-object-reference-text-help/313351>\
**Category:** Uncategorized\
**Created:** [August 26, 2010, 7:31pm UTC](https://forum.kirupa.com/t/null-object-reference-text-help/313351 "2010-08-26T19:31:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcapecci](https://avatars.discourse-cdn.com/v4/letter/b/ac8455/32.png) [@bcapecci](https://forum.kirupa.com/u/bcapecci)\
**Post date:** [August 26, 2010, 7:31pm UTC](https://forum.kirupa.com/t/null-object-reference-text-help/313351/1 "2010-08-26T19:31:28Z")

</div>

Pretty simple error but I cannot figure out how the hell to fix it. I have a movieclip that I add to the stage and I’m trying to reference a input text field on the second frame. When I trace the textfield on the first frame via the constructor it returns object textfield correctly. When I hit the enter button to go to the second frame where I will need to use password… I get a null when tracing. I can see it, I can write in it and no matter what I do I cannot seem to reference it. Before you ask I do spell the instance name correctly and obviously these are in classes but I show what’s applicable. Please help and thanks in advance!!

```auto

public function Registration():void
        {
            trace(this.usernameField); //returns textfield correctly
            this.enterButton.addEventListener(MouseEvent.MOUSE_UP, currentPanelSubmitted);
        }

        public function currentPanelSubmitted(event:MouseEvent) {
            if (currentPanel == "username") {
                this.gotoAndStop(2);
                currentPanel = "password";
                trace(this.passField); //returns null

```

In case you need the parent of registration its just the document class and I create registration like this…

```auto

var registration:Registration = new Registration();
addChild(registration); //ive also added it to the stage w/ no luck

```
