PDA

View Full Version : Dynamic content & menu


alsvik
03-17-2005, 05:25 PM
Hi

Wanted to create a flash-site for my uncle - and he wants to be able to alter the content weekly, and want (need) to be able to ONLY edit plain text.
It's no problem loading .txt-files into flash, but ashe said: "What if i want to alter a title on a button?"
- No problem i replied, but i guess i was a little to hasty there... :rolleyes:

I can load text into text-fiels like this:

loadVarsText = new loadVars();
loadVarsText.load("events.txt");
loadVarsText.onLoad = function(success) {
if (success){
trace ("done loading");

System.useCodepage=true;
scroller.html = true;
scroller.htmlText = this.var1
}else{
trace ("not loaded");
}
}


And i can add this to buttons, so it changes the content of the textfield (scroller):

on (release) {
loadVarsText = new loadVars();
loadVarsText.load("contacts.txt");
loadVarsText.onLoad = function(success) {
if (success){
trace ("done loading");


System.useCodepage=true;
scroller.html = true;
scroller.htmlText = this.var1
}else{
trace ("not loaded");
}
}

}


But how do i load the text onto the different buttons?
I could probably create a button.txt and add different var's for different buttons. But can anyone explain how to load the titles onto the button?!

alsvik
03-18-2005, 11:37 AM
let me re-phrase:

Is it possible to dynamically retrive text from a .txt file and place it a an button? If, then how?