# Using a listener with a movie clip?

**URL:** <https://forum.kirupa.com/t/using-a-listener-with-a-movie-clip/245490>\
**Category:** flash\
**Created:** [November 30, 2007, 6:15am UTC](https://forum.kirupa.com/t/using-a-listener-with-a-movie-clip/245490 "2007-11-30T06:15:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![combustion007](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@combustion007](https://forum.kirupa.com/u/combustion007)\
**Post date:** [November 30, 2007, 6:15am UTC](https://forum.kirupa.com/t/using-a-listener-with-a-movie-clip/245490/1 "2007-11-30T06:15:34Z")

</div>

Hello,

I would highly appreciate it if someone can help me out. I would like to have a listener invoke a function when user clicks on the movie clip. This is what I have so far:

I have placed a movieclip called clip\_mc on the stage and given clip\_mc as instance name. On Action layer this is what I have:

```php

   
var myListener = new Object();
myListener.onPress = function(){
    trace("HELLO");
}

clip_mc.addListener(myListener);

```

Thanks.
