dzy2566
11-28-2003, 04:57 PM
Hello all! I'm just starting to play with loading variables from external txt files using the LoadVars class. I read in the AS cookbook that all variables must be url encoded, using '+' for spaces and hexidecimal code for non alpha-numeric characters. I used the below script as a test, to populate two dynamic text fields with the contents of a txt file.myVar = new LoadVars();
myVar.load("1.txt","");
myVar.onLoad = function(success){
if(!success){
trace("didn't work");
}else {
_root.title.text = this.test;
_root.testD.text = this.otherV;
}
}I was surprised to find that I didn't have to use '+' for spaces or (for example) '%21' in pace of an '!'. This concerns me, because I thought maybe it was working now but in other browsers or other platforms I might not get the same results. So I'm aprehensive about ignoring the url encode rule. Can anyone shed some light on this?
myVar.load("1.txt","");
myVar.onLoad = function(success){
if(!success){
trace("didn't work");
}else {
_root.title.text = this.test;
_root.testD.text = this.otherV;
}
}I was surprised to find that I didn't have to use '+' for spaces or (for example) '%21' in pace of an '!'. This concerns me, because I thought maybe it was working now but in other browsers or other platforms I might not get the same results. So I'm aprehensive about ignoring the url encode rule. Can anyone shed some light on this?