I’ve got some code that draws a series of buttons. I’d like to label the buttons with an array that’s in an external text file. I’ve got this:
var patNumsArray:Array = new Array();
loadText = new LoadVars();
loadText.onLoad = function(){
this[“button”+i].textBox = this.patNum;
}
patNumsArray.loadText.load(“patentNumbersText.txt”);
and then below I’ve got
var myFormat:TextFormat = new TextFormat();
myFormat.align = “center”;
myFormat.font = “Arial Bold”;
myFormat.size = 16;
myFormat.color = 0xFFFFFF;
this[“button”+i].textBox.embedFonts = true;
this[“button”+i].textBox.selectable = false;
this[“button”+i].textBox.antiAliasType = “advanced”;
this[“button”+i].createTextField(“textBox”, this[“button”+i].getNextHighestDepth(), 0, 2, this[“button”+i]._width, this[“button”+i]._height);
this[“button”+i].textBox.text = patNumsArray*;
this[“button”+i].textBox.setTextFormat(myFormat);
But I can’t seem to get it to see the text file with the button names. Any help appreciated!