# Referance a dynamicly created movie clip

**URL:** <https://forum.kirupa.com/t/referance-a-dynamicly-created-movie-clip/70278>\
**Category:** flash\
**Created:** [November 12, 2004, 2:28am UTC](https://forum.kirupa.com/t/referance-a-dynamicly-created-movie-clip/70278 "2004-11-12T02:28:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixcels](https://avatars.discourse-cdn.com/v4/letter/p/ee59a6/32.png) [@pixcels](https://forum.kirupa.com/u/pixcels)\
**Post date:** [November 12, 2004, 2:28am UTC](https://forum.kirupa.com/t/referance-a-dynamicly-created-movie-clip/70278/1 "2004-11-12T02:28:56Z")

</div>

using this code:

```auto
this.createEmptyMovieClip("myMovieClip", 10);

```

and then make that movie clip a button. I know it has to be in how I referance it but I can not seem to figure it out.  
I can make it load an image but can not make it clickable. Here is that total code that I am using:

```auto
 
this.createEmptyMovieClip("myMovieClip", this.getNextHighestDepth(), {_x:100, _y:100});;
myMovieClip.loadMovie("[http://www.macromedia.com/images/shared/product_boxes/80x92/studio_flashpro.jpg](http://www.macromedia.com/images/shared/product_boxes/80x92/studio_flashpro.jpg)");
//This is the part that does not work
myMovieClip.onRelease = function(){
trace("button hit")
}

```
