Dynamically loading text, only more complex

Depending which button is pressed in a menu, I want to dynamically load different text from a text file into the same movie clip > text box.

That is, I do not want to have to create duplicated movie clip instances, each linked to a different button, in order to achieve this.

Im guessing there will need to be some code in the movie clip similar to the following…

“if button pressed = news, then load news.text into text box
else if button pressed = about, then load about.text into textbox”

etc.

Im sure it’s possible, but my actionscript skills arent yet that advanced…

Any ideas?

just have eash action for each button seperate. Each button shouldnt run the same code (well its not that they shouldnt, but rather often dont) and then go through the same if/else clause for determining which button it is. Just have each button load the text in

button1.onRelease = function(){
someMovieClip.loadVariables(“text1.txt”);
}
button2.onRelease = function(){
someMovieClip.loadVariables(“text2.txt”);
}

where the text variable in the .txt files are the same as the variable name (not instance name) of the textfield in the someMovieClip

yup. Already worked it out. I should try spending a little more time thinking before I ask simple questions…

Thanks all the same!! :slight_smile: