alrav79
asked on
DuplicateMovie and Buttons...
Hey there guys. I am running a duplicate movie loop that is retrieving its information from an array that loaded an xml. The movies are duplicating fine, however, I am assigning each movie's button to get a certain url with onRelease. The problem is that the buttons are all loadaing the same url for some reason. Is this because they are all pointing to the same function?
for (i=0; i<shows.length; i++) {
duplicateMovieClip(slot, "slot"+i, i);
slot = eval("slot"+i);
slot._y += x;
//------------------------ ---------- ---
//trace(slot);
//------------------------ ---------- ---------- -
slot.photoImage = shows[i].photoImage;
slot.showTitle = shows[i].showTitle;
slot.desc = shows[i].desc;
slot.link = shows[i].link;
slot.button.onRelease = function() { getUrl(slot.link); }
loadMovie(slot.photoImage, slot.cargathumb);
}
for (i=0; i<shows.length; i++) {
duplicateMovieClip(slot, "slot"+i, i);
slot = eval("slot"+i);
slot._y += x;
//------------------------
//trace(slot);
//------------------------
slot.photoImage = shows[i].photoImage;
slot.showTitle = shows[i].showTitle;
slot.desc = shows[i].desc;
slot.link = shows[i].link;
slot.button.onRelease = function() { getUrl(slot.link); }
loadMovie(slot.photoImage,
}
here is the fixed CODE:
---------
for (i=0; i<shows.length; i++)
{
duplicateMovieClip(slot, "slot"+i, i);
slot = eval("slot"+i);
slot._y += x;
//------------------------ ---------- ---
//trace(slot);
//------------------------ ---------- ---------- -
slot.photoImage = shows[i].photoImage;
slot.showTitle = shows[i].showTitle;
slot.desc = shows[i].desc;
slot.link = shows[i].link;
slot.button.onRelease = function()
{
getURL(this._parent.link);
};
loadMovie(slot.photoImage, slot.cargathumb);
}
---------
Rgds
Aneesh
---------
for (i=0; i<shows.length; i++)
{
duplicateMovieClip(slot, "slot"+i, i);
slot = eval("slot"+i);
slot._y += x;
//------------------------
//trace(slot);
//------------------------
slot.photoImage = shows[i].photoImage;
slot.showTitle = shows[i].showTitle;
slot.desc = shows[i].desc;
slot.link = shows[i].link;
slot.button.onRelease = function()
{
getURL(this._parent.link);
};
loadMovie(slot.photoImage,
}
---------
Rgds
Aneesh
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
function printer() {
slot._y = -x;
for (i=0; i<shows.length; i++) {
duplicateMovieClip(slot, "slot"+i, i);
slot = eval("slot"+i);
slot._y += x;
//------------------------
//trace(slot);
//------------------------
slot.photoImage = shows[i].photoImage;
slot.showTitle = shows[i].showTitle;
slot.desc = shows[i].desc;
slot.link = shows[i].link;
slot.button.btnLink = slot.link;
slot.button.onRelease = function() { trace(this.btnLink); }
loadMovie(slot.photoImage,
}
}