Issues accessing variables in MovieClip from a Class

I’m writing a little application to run a course, and the engine creates the navigation menu putting labels in the button etc…

So, as far as I change things like a dynamic text that’s on the stage with something like

mybutton.itemText.text = my_xml.childNodes[0].childNodes[index-1].attributes[“Label”];

this works, but what If I want to change a variable declared in the button?

I would like to retrieve from an XML the movie I want to load pressing this particular button, but seems like the scope of the “designed” objects and the programmed object is a little different, since with

in the button movieclip


var myMovieDelegate:String = new String();
var selectedButton:Boolean = new Boolean();

in the engine Class

mybutton.myMovieDelegate(my_xml.childNodes[0].childNodes[index-1].attributes[“MovieToLoad”]);

this doesn’t works, as doesn’t works creating a function in the button to set the variable like

function setMovieDelegate(movie:String):Void {
myMovieDelegate = movie;
}

Where’s the problem? I’ve included a simplified version of the interface, the classes and the code is not 100% functional…