I have one dynamic text box that has a variable name 'info'.
I have 6 buttons that I want to load in a different text file into this 'info' box each time the user releases the button.
Hence placing a new text file into 'info'.
I have set up one text file using '&info=' but how can I dynamically load in my others when the user clicks on another button??
thanks, So, are text1, text2 etc. variables that hold the text strings and sit on frame 1 of the site? Or are these text files that are loaded in when the button is released?
Yes, they are variables holding your strings. They are loaded on the first frame (if they are coming from a text file), so they are already there when the user click on the button.
You can put all your texts in a single .txt file, with text1="your first text"&text2="your second text"&text3="your third text"...
this way, when it loads (with loadvariables) in flash, they already are associated with variables, placed on the main timeline.
The code provided in my preceeding message must not be on the button itself, but on the maintimeline. Ideally, you also put the code describing the onRelease also on frame 1, but since flash will have to load the text file, it will be a good idea to put it later on, to give flash the time to load it. Using loadVars, you can use an onLoad event.
If you prefer to put the code on the button, you would use on (release)... instead on myButton.onRelease = function()...