# Mouse EventPropagation

**URL:** https://forum.kirupa.com/t/mouse-eventpropagation/289087
**Category:** flash
**Created:** [May 26, 2009, 9:29am UTC](https://forum.kirupa.com/t/mouse-eventpropagation/289087 "2009-05-26T09:29:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![laserra](https://avatars.discourse-cdn.com/v4/letter/l/d9b06d/32.png) [@laserra](https://forum.kirupa.com/u/laserra)
#### Post date: [May 26, 2009, 9:29am UTC](https://forum.kirupa.com/t/mouse-eventpropagation/289087/1 "2009-05-26T09:29:11Z")

</div>

Hi everyone,

I’m making a kids drawing board. The application is almost complete, but there’s a problem that still troubles me, and it has to do with eventPropagtion, and I’m not able to stop it.

Basically my problem is that, I must put a MovieClip attached to the mouse cursor, and bcuase of this an event is called without any intervention of the user.

This is the general picture. If someone has an ideia will be very welcome 🙂

I tried the stopPropagation and the mouseEnabled but no success till now.

I’ll try to explain a bit more about the code:

[FONT=Courier New]public function ColoringBook() {  
//This will place movieClip in the mouse position  
Mouse.hide();  
this.addChild(rato);  
rato.x = mouseX;  
rato.y = mouseY;

//These are the events for the drawing board (wich is a sprite) and the user will draw a shape  
drBoard.addEventListener(MouseEvent.MOUSE\_OUT,boardOut);  
drBoard.addEventListener(MouseEvent.MOUSE\_MOVE,boardMove);  
drBoard.addEventListener(MouseEvent.MOUSE\_DOWN,boardDown);  
drBoard.addEventListener(MouseEvent.MOUSE\_UP, boardUp);

//This event will make the movieClip “rato” to follow the mouse  
stage.addEventListener(MouseEvent.MOUSE\_MOVE, funcRato);

//placed this at the end of the constructor  
rato.mouseEnabled = false;[/FONT]  
}

Here is where I think the problem is, because everytime I move the cursor to the right, it stops making the drawing line, even with the stopPropagation (you can see the effect in the image that I attach). On the stage I have a Sprite, and the shapes are drawed inside this Sprite.

[FONT=Courier New]private function boardOut(e:MouseEvent):void {  
e.stopPropagation();  
trace(“boardOut”);  
doDraw=false;  
}[/FONT]

Inside the cursor movieClip, there is no event handling, and the only “interaction” is the tip color change when the user selects a color.

If I dont attach the movieClip to the mousecursor, this works fine.

Any thoughts? Any questions?

Thanks
