Many thanks to you...One more question tho...
Say for example I want to place, dynamically, those 11 buttons, which I have done using your suggestion, now I want to dynamically assign those eleven buttons unique names. How can I do that? I have tried to do so using a case select scenario. I haven't yet gotten it to work.
This is what I have tried.
//this variable will ultimately come from from the xml document
title = "Agricultural Equipment";
//this variable will ultimately come from from the xml document
maxButtons = 11;
nbrColumns = 3;
leftMargin = Stage.width/5;
topMargin = Stage.height/4;
space = 12;
cellWidth = 286.9+space;
cellHeight = 89+space;
trace(Stage.width);
bsntext = "";
b.text = "";
for (i=0; i<maxButtons; ++i) {
attachMovie("MenuItemButton", 'MenuItemButton'+i, i);
MenuItemButton[i].buttonshortname.text = bsntext;
MenuItemButton[i].buttontext.text = btext;
loadMovie("thumbs/AG/agmanagementsolutions.jpg", MenuItemButton0.icon);
var mc = eval("MenuItemButton"+i);
var cellX = i%nbrColumns;
var cellY = Math.floor(i/nbrColumns);
mc._x = leftMargin+cellX*cellWidth;
mc._y = topMargin+cellY*cellHeight;
eval('MenuItemButton'+i).onPress = function() {
trace("this is mc"+this);
this.gotoAndStop(2);
this.onRelease = function() {
this.gotoAndStop(1);
};
var i = i;
switch (i) {
case 0 :
bsntext = "Ag Management Solutions";
break;
case 1 :
bsntext = "Cotton Harvesting";
break;
default :
bsntext = "testing 1 2 3";
}
trace("this is i"+i);
};
}
Thank you in advance for your expertise.