-
1. Re: Little AS2 challenging me with LoadVars
kglad Oct 15, 2010 8:43 PM (in response to Hisham Attia)nothing change from cs2 as2 to cs5 as2.
that said, the load method can be problematic. it's more reliable to use 2 loadvars instances and use sendAndLoad:
Hisham Attia wrote:
var sendLV:LoadVars = new LoadVars();
var receiveLV:LoadVars = new LoadVars();
receiveLV.onLoad = function(success) {
if (success) {
loadedInfo.htmlText = this.info;
} else {
loadedInfo.text="ERROR in loading the information."
}
sendLV.sendAndLoad("vars/scara.txt",receiveLV,"POST");
-
2. Re: Little AS2 challenging me with LoadVars
Hisham Attia Oct 16, 2010 1:26 AM (in response to kglad)Hi and thanks for your prompt response.
AS2 may have not change but saving the file to CS5 definitely has changed something.
I tried as you suggested but receive the same result.
I went back to my CS2 fla file and changed the .txt and that swf loads the text just fine.
I opened the CS2 fla and saved it to CS5 fla and published it, but this swf is not loading the text.
What could this be? Hmm...
h
-
3. Re: Little AS2 challenging me with LoadVars
Hisham Attia Oct 16, 2010 1:47 AM (in response to Hisham Attia)Okay, I narrowed down the problem to a CSS problem in the text file.
I use <span class"..."> in my .txt file. I removed them and the text loaded fine.
I wonder what is wrong with them, as these styles are globally defined and still work in other pages. That is a little mysterious.
-
4. Re: Little AS2 challenging me with LoadVars
kglad Oct 16, 2010 8:16 AM (in response to Hisham Attia)ampersands have a special meaning and need to be url-encoded but i don't remember angle brackets causing a problem.
-
5. Re: Little AS2 challenging me with LoadVars
Hisham Attia Oct 17, 2010 3:01 AM (in response to kglad)yeah, they shouldn't be a problem, as the text includes the usual code, such as <br><p> and others.
It may be something to do with the actual CSS file itself, as all html code works fine. Only my defined CSS styles seem to be causing the probs.
Anyway, thanks for the help. I keep investigating further more, and change style-names and see what is happening here.
-
6. Re: Little AS2 challenging me with LoadVars
kglad Oct 17, 2010 9:09 AM (in response to Hisham Attia)you're not expecting your styles defined in that text file to apply to a textfield, are you? that won't work.
you can load a css style sheet and apply that to the styleSheet property of a textfield but you can't assign the htmlText and styles in one step.
-
7. Re: Little AS2 challenging me with LoadVars
Hisham Attia Oct 18, 2010 12:29 AM (in response to kglad)Thanks. Yes, I do load the CSS style sheet prior to applying the styles to the textfield. It is external file. Cheers.
-
8. Re: Little AS2 challenging me with LoadVars
kglad Oct 18, 2010 1:27 PM (in response to Hisham Attia)you're welcome



