# mouseChildren = false not wroking very well fo me

**URL:** <https://forum.kirupa.com/t/mousechildren-false-not-wroking-very-well-fo-me/326653>\
**Category:** Uncategorized\
**Created:** [January 2, 2012, 11:50pm UTC](https://forum.kirupa.com/t/mousechildren-false-not-wroking-very-well-fo-me/326653 "2012-01-02T23:50:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nouatzi](https://avatars.discourse-cdn.com/v4/letter/n/91b2a8/32.png) [@nouatzi](https://forum.kirupa.com/u/nouatzi)\
**Post date:** [January 2, 2012, 11:50pm UTC](https://forum.kirupa.com/t/mousechildren-false-not-wroking-very-well-fo-me/326653/1 "2012-01-02T23:50:53Z")

</div>

Hi everybody,  
Happy new year btw !

I want to separate event handling from a container and it child. So as you can see, my source code is very simple :

```auto

package {
	import flash.display.Sprite;
	import flash.display.*;
	import flash.events.*;
	
	public class test extends Sprite{
		
		public function test() {
			var container:Sprite = new Sprite(); // my container
			container.graphics.beginFill(0, 1); // whatever the color
			container.graphics.drawRect(0, 0, 100, 100); // origin at 0,0
			container.graphics.endFill();
			addChild(container);
			
			var decor:Sprite = new Sprite(); // and it child
			decor.graphics.beginFill(0, 1); // whatever the color
			decor.graphics.drawRect(200, 200, 100, 100); // origin at 200,200
			decor.graphics.endFill();
			container.addChild(decor);
			container.mouseChildren = false;
			container.addEventListener(MouseEvent.ROLL_OVER, onOver, false, 0, true);
		}
		private function onOver(e: MouseEvent):void {
			trace("ROLL trace");
		}
	}
}

```

When I roll over the container object, I’ve got the trace (OK for me).  
BUT When I roll over the decor object, I’ve got the trace too (not what I want).  
I just want the container to be triggered by the mouse event, not it child.  
So what’s happened to my mouseChildren = false…? I don’t understand…

Thanks for any help.

B.R.
