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:
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):
tellTarget("loadPic.pic" + x)
{
this.createEmptyMovieClip("button" + x, x);
this.setProperty("pic.button" + x, _x, move);
this.loadMovie(ButtonMC, "pic.button" + x);
}