Confused with variable scope, or how to generate buttons

hello !

i’m having a hard time generating a menu from an mc in my library, that contains only a button and an empty textfield. The textfield instance name is myLabel and the button instance name is myButton.

Question1: when scripting the button behaviors, should i address the button or the containing mc ? I tried both, targeting the mc gives better results, but i find this illogical: according to the manual, you’re supposed to target the button AFAIU.

Question2: the values of the array “lang” are correctly displayed, except from within the onRollOver event. If i trace it, it indeed does not find the value. If i put the trace out of the function, it works correctly. So how can i access an array defined on the main timeline from within that function ? i tried _root.lang and _global.lang but no success… “undefined”

So, here is the code, i hope someone can tell me what i’m doing wrong:

// generate the main bot textfield
var bot_txt:TextField = this.createTextField(“bot_txt”, this.getNextHighestDepth(), 10, 5, 220, 25);
bot_txt.multiline = true;
bot_txt.wordWrap = true;
bot_txt.text = “Please choose your language :”;
// generate the language buttons
for (i=0; i<lang.length; i++)
var my_button_mc:String = lang*[0]+"_butt";
var ypos:Number = 40+i20;
var butt:MovieClip = this.attachMovie(“lang_button”, my_button_mc, i, {_x:100, _y:ypos});
// sets the button"s label
this.butt.myLabel.text = lang
trace (lang*[2]);
//sets the button"s behaviors
this.butt.onRollOver = function()
//trace (_level0.lang*[0]);
var val:String = lang*[0];
bot_txt.text = val;

this.butt.onRollOut = function()