I have the following function, but I can t seem to get the myVar variable into the inline function. What am I doing wrong here? What I would like to have happen is when I click on myMc, it should print myVar to the console ("hello computer").
function doSomething():Void { myVar = "hello computer"; myMc.onRelease = function(){ trace(myVar); //prints as "undefined" } }
ps. - I cannot declare myVar as a global or static variable because in the real code, I m parsing XML and the myVar is constantly changing.