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:
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:
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?