Hi guys,
I’m trying to make a navigation of sorts using a bunch of thumbnails there will be 3 columns and 3 rows.
I have made an array of images, created a button with an empty movie clip in it. And I am attempting to make a 3 by 3 grid of buttons based off the array… Here is my code.
cubicThumbs = [“Bracelet_Nugget_1_thmb.jpg”,“Earring_Nugget_1_thmb.jpg”,“Necklace_Nugget_1_thmb.jpg”,“Earring_Nugget_1_thmb.jpg”,“Necklace_Nugget_1_thmb.jpg”];
var YPos = -133;
var XPos = 138;
var numOfItems:Number;
var vSpace = _width+3;
var hSpace = _height+3;
var n = 0;
function buildThumbs(){
for (var i=0; i<cubicThumbs.length; i++) {
numOfItems = Math.round(i);
var menu = attachMovie(“Btn”,“NewBtn”+i,i,{_x:XPos,_y:YPos});
if (numOfItems<=3){
XPos += this[“NewBtn”+i]._width+2;
}else{
// here is where I am stuck
}
menu._x = XPos;
menu._y = YPos;
this["NewBtn"+i].eclip.loadMovie(directory + cubicThumbs*);
}
}
buildThumbs();
I have figured out how to display them all in one row, however I can not figure out how to , if there are more than 3 in the array to move down to a new row and so on…
Also if there are more than 9 to build the menu with 3 columns and 3 rows and then move over on the _x 50 pixels and start over again at the top.
Can anyone help me? I am clueless.
Thanks