Dynamic, changing text

I am trying to create a image gallery with captions.

I have a text box on a MC, my images on a separate MC, and my buttons on another.

I can load a single text file into the text box, using the buttons, with a load variable action.

however i am lost as to how to load a different text file into the same text box from a different button.

IE. button 1 loads text 1 in textbox ‘caps’
Button 2 loads text 2 in textbox ‘caps’

My solution is to have all my text as separate MC’s on the text box and each button does a tell target.

My scripting on a scale of 10 is 2
Pls help

you buttons code should look something like this:

button1:

on(release){
_root.caps=“text1 goes here”;
}

button2:

on(release){
_root.caps=“text2 goes here”;
}

button3:

on(release){
_root.caps=“text3 goes here”;
}

This code assumes that your textbox is on the root and that in properties panel for the textbox, in the var section, you’ve put the variable name “caps” (without quotes).

Sorry for the slow response, my Internet connection had probs

That works, I can put the text into the action, much better than the movie clips.

I didn’t know it could be done so simply.

I did however want the buttons to load the text from external files, but at the moment i am in no position to dog a working solution.

If it is relatively simple or doesn’t take major con’script’ion i wouldn’t mind

Thanks for the help.

your text file has to have variables declared like

text1=“this is my text for button 1”&text2=“this is my text for button2”

put all this into one file, call the file whatever you want (like button.txt)

use loadvariables(“button.txt”,"_root.caps")

Ok, But just a few more Questions,

Where does the action go,
and how does each button know which text to display?

I have seen something similar but couldn’t work it out!!

:-\

Cheers for you time