Syntax error? Please help!

Hi. I’m new to AS and I would like to know how I can set the value of a variable and then retrieve it in another frame. To put this into context, I would like to dynamically load an external text file for different restaurant menus - depending on which button is clicked. I.e. Mains >> “mains.txt”.

What I have so far in the dynamic text box AS is the following:

loadText = new LoadVars();
loadText.load(_root.menuclicked + “.txt”);
loadText.onLoad = function() {
scroller.text = this.menu;
};

Plus the following AS for each button (with its respective variable name):

on(press){
_root.menuclicked = ‘beverages’;
}

What is wrong with this, and how can I get it to work? Thanks in advance for any help - it would be greatly appreciated. :slight_smile: