# Syntax error? Please help!

**URL:** <https://forum.kirupa.com/t/syntax-error-please-help/285076>\
**Category:** flash\
**Created:** [March 26, 2009, 7:36pm UTC](https://forum.kirupa.com/t/syntax-error-please-help/285076 "2009-03-26T19:36:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyA](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@AndyA](https://forum.kirupa.com/u/AndyA)\
**Post date:** [March 26, 2009, 7:36pm UTC](https://forum.kirupa.com/t/syntax-error-please-help/285076/1 "2009-03-26T19:36:56Z")

</div>

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. 🙂
