Continued from here: http://stackoverflow.com/questions/2906847/create-variable-from-array-actionscript-3
I'm usually not this rushed, but I have to have this project finished by tonight... so any help is appreciated. The poster there gave me the following code, which gets "access of undefined property i" on the second line. All the items in the list are movie clips, and I have a second movieclip in the library with the same name, but has "_frame" appended to it (menu_bag_mc_frame), and for every time that each corresponding array item is clicked, I need to create a variable item with the same name and _frame appended to the end.
var menuList:Array = [menu_bag_mc,menu_chips_mc,menu_coke_mc];
var className:String = menuList[i] + "_frame";
var frameVarClass:Class = flash.utils.getDefinitionByName(className) as Class;
var framevar:MovieClip = new frameVarClass() as MovieClip;
MovieClip(root).addChild(framevar);
Why do I get an undefined property?