flash external text file
- Started
- Last post
- 8 Responses
- sinisnap
two swfs. main swf loads the sub swf into a container mc onclick of a button.
im doing a loadvariables on an external text file containing variables for dynamic text boxes into the sub swf. text appears correctly when i test the sub swf.
however when i test the main swf and click the button to load the sub swf, the text doesn't appear.
any thoughts?
sorry i know this isn't a flash forum but i've noticed some amazing answers to flash questions in here so im hoping someone can give me some insight here.
- unfittoprint0
use the LoadVars object instead.
myVars = new LoadVars();
myVars.onLoad = function(sucess){
if(sucess){
textBox.text = this.var;
} else{
trace("ooops!");
};
}button.onPress = function(){
myvars.load("vars.txt");
}
- sinisnap0
agh, i suck so bad, i dont really know how to implement that code..
thanks tho, i'll keep playing with it til i figure it out
- sinisnap0
ah i figured it out. just in case anyone cares.
many thanks unfittoprint
- xaoscontrol0
did that code help? I ask because I have a similar problem though I don't to have to click a button to load the text file.
- sinisnap0
this helped me understand which variable went where in relation to my own movie
- bulletfactory0
from my experience - most of the time, it's just an addressing issue, it' looking for the swf at the wrong level in your file structure.
- j_red0
xaoscontrol, the code is a function that loads in text.
it basically just executes a line of code when the 'on release' is called.
so if you don't want it on the 'on release' then just put that line of code where you DO want it.
i hope that makes sense.
- xaoscontrol0
I think i understand..I'll just have to try it when I get home