create dynamic button with AS2
Hi, this is my code, my problem is how to turn this["mc"+i] to a clickable button, see the code near the end? it doesn't do it, in fact on the screen it's not even 'button-abled'. I did some research, couldn't find anything at all, please help.
what the script does to load a series of arrayFlag (ext jpeg files) into "mc"+i, and supposingly when you click these jpeg on screen would loadMovie to another mc, right now they re not behaving like buttons
for (var i=0; i<=flagArray.length; i++) {
arrayFlag="country/thumb/"+flagArray;
arrayBg="country/"+flagArray;
//--------flags-------
mybutton = this.createEmptyMovieClip("mc"+i, i);
this["mc"+i].loadMovie(arrayFlag);
this["mc"+i]._x=95+distance;
this["mc"+i]._y=0;
//---------Name----------
var str:String = flagArray.split(".jpg").join("");
trace (str);
this.createTextField("my_txt"+i, 100+i, distance, 12, 100, 100);
this["my_txt"+i].text = str;
this["my_txt"+i].setTextFormat(format2);
//--------Text-----------
this.createTextField("my_title"+i,200+i, distance, 0, 150, 100);
this["my_title"+i].text = "Country Name:";
this["my_title"+i].setTextFormat(format1);
//-----loadMovie---------
this["mc"+i].onRelease = function () { <<-- not working
mc.loadMovie(arrayBg);
}
distance+=193;
trace(flagArray);
}
