# addEventListener question

**URL:** <https://forum.kirupa.com/t/addeventlistener-question/242691>\
**Category:** Uncategorized\
**Created:** [October 29, 2007, 4:29pm UTC](https://forum.kirupa.com/t/addeventlistener-question/242691 "2007-10-29T16:29:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![absolutezero342](https://avatars.discourse-cdn.com/v4/letter/a/22d042/32.png) [@absolutezero342](https://forum.kirupa.com/u/absolutezero342)\
**Post date:** [October 29, 2007, 4:29pm UTC](https://forum.kirupa.com/t/addeventlistener-question/242691/1 "2007-10-29T16:29:22Z")

</div>

I’m having a weird issue where I have a main MC in the library and it contains a header MC and the header MC contains a dynamic text field.

When I add the main MC to the stage I also add an event listener for the header MC to detect MOUSE\_DOWN. I never add a MOUSE\_DOWN event listener for the dynamic text field which is contained within header MC but when I test the movie I still trigger a MOUSE\_DOWN event listener for the dynamic text field. I know it is the text field triggering the event because I trace it’s name. Here’s my code:

```auto
function openFolder(e:MouseEvent):void{
 windows.push(new Window);
// trace(windows[windows.length - 1].id);
 windows[windows.length - 1].id = windows.length - 1;
 windows[windows.length - 1].x = windows[windows.length - 1].y = windows.length * 50;
 windows[windows.length - 1].x_btn.addEventListener(MouseEvent.CLICK, closeWindow);
 windows[windows.length - 1].windowBar_mc.addEventListener(MouseEvent.MOUSE_DOWN, moveWindow);
 windows[windows.length - 1].windowBar_mc.windowName.autoSize = TextFieldAutoSize.LEFT;
 
addChild(windows[windows.length - 1]);

}
 

```

it acts like I’ve added this code though:

```auto
 
windows[windows.length - 1].windowBar_mc.windowName.addEventListener(MouseEvent.MOUSE_DOWN, moveWindow);

```

where windowName is my dynamic text field. Does anyone know why that would be happening?
