0 Replies Latest reply on Aug 13, 2006 11:30 PM by s007767

    LoadVars nightmare

      I'm using LoadVars to communicate with a PHP page that does a query on a database. Things seem to work okay the first time through. The second time, it doesn't seem to update with the new data. Yes, I've used the new Date().getTime() trick. It's not a caching problem. If I use onData() to show me the raw string coming back from PHP, the data is the new data. It's like decode isn't being called again, even if I call it explicitly in onData.

      The first time around the string that comes back is action=userdata&dealer=blahblahblah. The second time around the string is action=certificate&code=blahblahblahblah. However, the line _root.debugger += "onLoad: " + this.action + "\n"; prints out onLoad: userdata both times even though the raw data has changed. What is going on?

      I've wasted hours trying to figure out why this isn't working. I use LoadVars and PHP all the time. I've never had this problem before. Flash doesn't have a decode string function independant of LoadVars (that I can find documented anywhere) and I have little interest in writing one of my own and parse the data in onData myself.


      UPDATE: I realized I didn't need to urlencode() my strings, which makes decodeing the incoming string much easier. So I manually decode the string and set the data values myself. (see onData #2) Still no dice. It sets the value the first time through but does not over write the data the second time. Why not? I even tried using an object in the _global scope instead of the LoadVars object ( _global.incoming[pair[0]] = pair[1]; ) Same thing. What is the deal? How come this seems to be a write once process going on here?