Hey there,
I’m trying to add a new row to dynamically created thumbnail grid.
So far I’ve copied and edited a BrainGiants PhotoDrop menu script and managed to add an new row there with a nested for loop, but the thumbnails on the new row won’t show right.
There’s just one thumb showing, I guess the rest of the thumbs are beneath the one showing…I’m messing up the for loop somehow, but can’t get a hold of it…
I know all the thumbs load fine cus I’ve tried to load them to just one row and all of them showed up properly.
here’s the code so far:
function buildMenu() {
//Create a photoMenu movie clip to hold the menu items
this.createEmptyMovieClip("photoMenu", this.getNextHighestDepth());
//position the photoMenu
photoMenu._x = 50;
photoMenu._y = 350;
menuLength = menuA.length;
//Spacer between elements
menuSpacer = 11;
//Starting x for each element
startX = 0;
startY = 0;
//Build the bottom menu
for (var i=0; i<6; i++) {
for(var j=0;j<=5;j++){
//attach an element for each menu item
photoMenu.attachMovie("element", "e"+i, i);
e = photoMenu["e"+i];
e.name = menuA*[0];
e.image = menuA*[1];
e.thumbnail.loadMovie("images/"+e.image+"_thumb.jpg");
e._x = startX;
e._y = startY;
e.onRollOver = function() {
this.menuOver.alphaTo(0, .1, "linear");
};
e.onRollOut = function() {
this.menuOver.alphaTo(50, .2, "linear");
};
e.onPress = function() {
//Call the new photo and info
changePhoto(this.name, this.image);
};
//When the last menu element is added, display the first photo
if (i == (6-1)) {
//Set initial record number and counter
recordNumber = 1;
// Display the first photo in the set
name = menuA[0][0];
image = menuA[0][1];
photoTitle.autoSize = "left";
changePhoto(name, image);
}
}
startX += e._width+menuSpacer;
}
e._y += e._height+menuSpacer;
e._x = 0;
}
Any suggestions/solutions are highly welcome, I’ve been struggling with this one for few days now.