# Mymovieclip.onMouseUp = function()

**URL:** <https://forum.kirupa.com/t/mymovieclip-onmouseup-function/160185>\
**Category:** Uncategorized\
**Created:** [August 24, 2005, 12:35am UTC](https://forum.kirupa.com/t/mymovieclip-onmouseup-function/160185 "2005-08-24T00:35:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rollwithit80](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rollwithit80](https://forum.kirupa.com/u/rollwithit80)\
**Post date:** [August 24, 2005, 12:35am UTC](https://forum.kirupa.com/t/mymovieclip-onmouseup-function/160185/1 "2005-08-24T00:35:37Z")

</div>

Hi Guys,  
I have just developed a simple xml photo gallery. Below is the code that I have used to generate the gallery:

```auto
var gallery = createEmptyMovieClip("galleryImage",0);
for (i=0; i<total; i++) {
	 cur_item = gallery.attachMovie("mainImage","spec"+i, i);
	 cur_item.loadMovie(thumb*, "mainImage");
	 cur_item.onMouseUp = function() {
    		    getURL(javascript:openWindow("products/"+id+"/"+image*));
	  };
}

```

I am having difficulties to make each movie clip generated into a button that will call the javascript button:

```auto
cur_item.onMouseUp = function() {
    		    getURL(javascript:openWindow("products/"+id+"/"+image*));
	  };

```

What i want to do is to allow the user to click on the movie clip and it will call javascript and open the image in a html window. For some reason I can’t get it to do anything. Am i using the correct code to do this?

Please advise

Much appreciated

Daniel
