Vars and Arrays

hello,

I am trying to understand the following code:


var desc:Array = new Array();

btn_mc.onRelease = function(){
    var link:String = "this.html";
    desc.push(link);
    trace(desc);
}


Simple enough, var desc will contain the string “this.html”.

However what is boggling me is when I do this…> (I get the var ‘link’ as undefined)


var desc:Array = new Array();

function hitme(){
    desc.push(link);
}

btn_mc.onRelease = function(){
    var link:String = "this.html";
    hitme(); 
}


I want to do this, so that each button has its own string, which then gets pushed into the hitme function, which in the end will direct the hit to getURL and move to a new web page.

Alas why am I losing the ‘link’ variable?!
And how can I solve it?:te: