# EventDispatcher and MovieClip

**URL:** <https://forum.kirupa.com/t/eventdispatcher-and-movieclip/175034>\
**Category:** flash\
**Created:** [January 11, 2006, 7:52am UTC](https://forum.kirupa.com/t/eventdispatcher-and-movieclip/175034 "2006-01-11T07:52:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kernel\_flash](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@kernel\_flash](https://forum.kirupa.com/u/kernel_flash)\
**Post date:** [January 11, 2006, 7:52am UTC](https://forum.kirupa.com/t/eventdispatcher-and-movieclip/175034/1 "2006-01-11T07:52:18Z")

</div>

Can anybody please help me understand how a MovieClip and EventDispatcher go hand in hand.

e.g.  
I have a box mc on stage. when i select this box mc and move I want to call some function.  
Yeah I know I can do that using following code.  
[AS]  
var boxselected=false;  
var listener=new Object();  
listener.onMouseMove=function()  
{  
if(boxselected)  
trace(“box moving”);  
}  
Mouse.addListener(listener);  
box.onPress=function()  
{  
boxselected=true;  
}  
box.onRelease=function()  
{  
boxselected=false;  
}  
[  
[/AS]

Suppose in this case I want a target of some movie clip available in onMouseMove function. This is not possible. However it can be done in EventDispatcher class.  
So I want to achieve the same thing with EventDispatcher class.

But I’m confused over how to get this done.

Please Help.
