Multiple loaded txt's for dif buttons?

ok, i got the rollovers i was working on done, but since its a full site that im making i need to have text, and since its not MY site, its my friends, i want to use the loadVariable action so he can edit the text without having to use flash, cuz he cant do it, i want to know if its possible to have different txt’s loaded for each button, so if he clicks on members button, it will show a differen txt then when he clicks on the main button

i basically can do loadvariable, i just did it, but im not sure if i can do multiple ones for different buttons to load…

someone tell me if its possible/how to do it.

ps: i havent seen a tut for this, i already checked around

Well if you use this tutorial…

http://www.kirupa.com/developer/mx/dynamic_scroller.asp

You can do this to add a different text file into the text area…

on (release){
loadText.load("kirupa.txt");
scroller.text = this.kirupatext;
}

I didn’t test it, but it should work.

if my text will only go down to the page i dont ahve to include the scroller part do i?

and if i wanted to make a header for each section, could i:
make a seperate dynamic text field, and in the Var box put something other than textField ? and then adjust the actions to load both the textField txt’s and the header txt’s?

No, if your text box does not need to scroll, you do not need to add the scrollbar.

If you want to have a seperate title text box, you do not need to load that dynamically, you can load it through AS.

Lets say you give your textbox the var name “title” (no quotes).

It would look something like this…

On a frame(for default text value when the page loads)…

title = "Main Title"

On the button…

on (release){
title = "New Title"
}

hi…

if you loading text into textfields via butts… how do you reset the scroll bar to the top…?

Cheerio’
B…

If you load in a new text file the scrollbar automatically goes back to the top.

the butt tryin to load the text is not loading the correct text doc… any ides why…?

load first text doc:

loadText = new loadVars();
loadText.load(“text.txt”);
loadText.onLoad = function() {
scroller.text = this.testtexta;
};

load second text doc from butt:

on (release){
loadText.load(“text2.txt”);
scroller.text = this.testtextb;
}

the first text doc is in the textfield when the butt is clicked…???

b…

What do you mean it is not loading the correct .txt document?

Is it not loading one? or is it loading the wrong one?

the first text file is still in the textfield… the second text file does not get loaded in at all…

b…

I guess that is what I get for not testing my code :-\

I will see what I can do.

cheers…

Ok, I have done this before, but it isn’t working now. I am not doing very good on the scripting part for these past 2 days, so forgive me. I could get it to load the new text, but it wouldn’t bring it to the top!..grrrr.

I did come up with this method though…

On your button put this…

on (release) {
	_root.scroller.text = "";
	_root.loadText.load("text2.txt");
	_root.loadText.onLoad = function() {
		scroller.text = this.testtextb;
	};
}

This clears the scroller textbox, which brings it to the top, then loads in the new textfile. Works like a charm :slight_smile:

magic…

cheers…

b…

ty, mine worked as well, but im not using scrollers, its not really necessary for me…

but the loadvar stuff is giving me trouble, i cant seeem to get it to work so that when i send the swf to my friend, and the txt’s and hes got all the same folders and stuff, how he can view it… =(

It should be viewed though :). Unless something wrong from your friend side!
:frowning:

Yeah, your friend did something wrong?

Did you send you friend the text files and everything together?

■■■■, well, who knows, my other idea is: is there some way i can post the txt’s on some freeserver domain or something jsut so he can see it for now?

Yeah, just upload all of your files.

damnt, w/e, my other friend is gonna host them, and in the loadvariabel AS, in the URL i put the url each one is gonna be hosted at?

If you have it in the same directory you don’t need a URL, just a filename.