# Turning Dynamic loadMovie JPEGS into Buttons

**URL:** <https://forum.kirupa.com/t/turning-dynamic-loadmovie-jpegs-into-buttons/161621>\
**Category:** flash\
**Created:** [September 5, 2005, 9:24pm UTC](https://forum.kirupa.com/t/turning-dynamic-loadmovie-jpegs-into-buttons/161621 "2005-09-05T21:24:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuildYourDeck](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@BuildYourDeck](https://forum.kirupa.com/u/BuildYourDeck)\
**Post date:** [September 5, 2005, 9:24pm UTC](https://forum.kirupa.com/t/turning-dynamic-loadmovie-jpegs-into-buttons/161621/1 "2005-09-05T21:24:06Z")

</div>

I am using PHP and XML to make a dynamic list of pictures. Each picture also has attributes with information concerning that picture. I have successfully loaded these images with the following code:

```auto

for( var x=0; x<Card.length; x++ )
{
	loadPic.createEmptyMovieClip("pic" + x, x);
	setProperty("loadPic.pic" + x, _x, move);	
	loadMovie(Card[x].attributes.pic, "loadPic.pic" + x);
	move += 25;
}

```

The above code displays each image 25 px from each other.

Here is the question: Now, I would like to make each of these images a button. When a user clicks on the button a variable changes in \_root that contains an attribute I have already set in the XML code.

I tried a couple of things, like looking for something along the lines of createEmptyButton instead of MovieClip but that does not exist.

I have also tried loading a 2nd MC that I have already added a button to and placing it on top of the pictures. However, trying that made the pictures dissappear.

Could someone please lead me in the right direction as to how I could change these loadMovie JPEGS into Buttons? I think I may have been on the right track with the 2nd MC, but I must grossly have the code wrong. This is what I used (placing it below the code above):

```auto

	tellTarget("loadPic.pic" + x)
	{
	 this.createEmptyMovieClip("button" + x, x);
	 this.setProperty("pic.button" + x, _x, move); 
	 this.loadMovie(ButtonMC, "pic.button" + x); 
	}

```
