String to Movieclip instance name

Hi,

I have a function to set focus to a movieclip. Something’s wrong, not sure what… I’m blinded by this, and need help!

:ro:

First I’m creating a movieclip container and populating this with movieclips that will make up a menu. Next step is to give focus to the first “tab” initially, and then to have a selecteditem variable that changes as the focus changes…

//Creates an empty movieclip for containing the menu
menu_container = this.createEmptyMovieClip(“main_menu_mc”, this.getNextHighestDepth());
menu_container._y = 20;

//Counts through the categorynodes_array and adds buttons
//Adds the category name and description to the textfields in “tab”
for (var i = 0; i<_root.categorynodes_array.length; i++) {
var m = menu_container.attachMovie(“tab”, “tab”+i+"_mc", i);
m.categoryname_txt.text = _root.categorynames_array*;
m.categorydescription_txt.text = _root.categorydescriptions_array*;
m._x = 30;
m._y = (m._height+20)*i;

function setTabFocus(tab) {
var tab:Number = tab;
var tab_mc:String = “main_menu_mc.tab” + tab + “_mc”;
trace (tab_mc);
if (selectedItem == null) {
//Selection.setFocus(main_menu_mc.tab0_mc);
Selection.setFocus[tab_mc];
} else {
Selection.setFocus(selectedItem);
}
}
setTabFocus(1);
trace(Selection.getFocus());

Pretty please, help me!
:sailor: