PDA

View Full Version : LoadVars class


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?

Colin Campbell
11-28-2003, 07:55 PM
Hey dzy,

Where you been? You haven't been on in a while.

If you're using MX, theres no need for URL encoded text. That was only Flash 5 and below. I forget where I read this, but I know that is the case. If you are going to export to Flash Player 6, then you're ok just using normal text, but anything lower you need to URL encode it. Hope that helps,

Colin

dzy2566
11-28-2003, 08:14 PM
Beautiful. Thanks Colin. Yeah, I've been in hiding for a while. I've been learning PHP, SQL, XML and as far as flash goes I've been working on a cartoon so I haven't really had any time for the forums. I've been trying to keep an eye on them for my own sake an others, but since I changed jobs I don't have as much free time at work for the AS forums. Nice to be missed :D I'll try to make more time for it. Thanks again.