# Error 2025 with eventlistener

**URL:** <https://forum.kirupa.com/t/error-2025-with-eventlistener/327327>\
**Category:** flash\
**Created:** [February 22, 2012, 3:20am UTC](https://forum.kirupa.com/t/error-2025-with-eventlistener/327327 "2012-02-22T03:20:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackout188](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@blackout188](https://forum.kirupa.com/u/blackout188)\
**Post date:** [February 22, 2012, 3:20am UTC](https://forum.kirupa.com/t/error-2025-with-eventlistener/327327/1 "2012-02-22T03:20:49Z")

</div>

a function generating the game buttons

```auto
public function showGameButton(buttonLabel:String,Name:String,xcord:int,ycord:int) {
   gameButton = new GameButton();
   gameButton.label.text = buttonLabel;
   gameButton.x = xcord;
   gameButton.y = ycord;
   gameSprite.addChild(gameButton);
   gameButton.name=Name;
   addChild(gameButton);
   trace(getChildByName("gobtn"))
   
  }

```

another that access it

```auto

public function xmlLoaded(event:Event) {
   dataXML = XML(event.target.data);
   gameSprite.removeChild(messageField);
   messageField = createText("Get ready for the first question!",questionFormat,gameSprite,0,60,800);
   showGameButton("GO!","gobtn",350,550);
   gobtn=MovieClip(getChildByName("gobtn"));
   gobtn.addEventListener(MouseEvent.CLICK,pressedGameButton);
  }

```

and I get error 2025 something about the parent, does anyone know how to resolve it?

Many thanks
