*blog... kind of... *rss
[AS] Problems with myXML.load(url) and multiple GET vars. 21.03.2007 | |
| I was developing another little game, and I've been fighting with it for a couple of days, and after trying to locate the problem, seems like in the end it is just a limitation of the myXML.load() function.
A bit of detail about it:
I'm trying to send the scores to my .php at the same time I'm getting the updated list of scores in a XML format, something like:
myXML.load( "scores.php?action=submit_score &name=mr.doob &score=1000 &code=893493" );
So, the php will update the highscores table, and then It will give back the updated table in a XML format. However seems like this doesn't work. For some reason Flash doesn't ever do the call. I've debugged a lot this and this is what I've found:
myXML.load( "scores.php?action=submit_score" ); Works properly, Flash does the call, and it gets the XML back.
myXML.load( "scores.php?action=submit_score &name=mr.doob" ); Works properly, Flash does the call, and it gets the XML back.
myXML.load( "scores.php?action=submit_score &name=mr.doob &score=1000" ); Doesn't work!!
Seems like if you send more than 2 GET variables then flash won't do the call, and I know that it won't do the call because I've a logger on my php code that is saving all the calls that is getting on a .txt file.
Does anyone know if there is any workaround? I'll use a loadvars to send the scores and then get the XML again with a simple call. | | posted by mr.doob at 16:17 | | 2 comments written so far |
| Its weird, I've never had that problem... Have you tried with the sendAndLoad method?
Anyway, you could use the ouput of a loadvars request to parse it as a XML... would be something like this:
php ouput:
&estado=ok&xml= blahblah&
flash:
miLV.onLoad = function() {
var xml= new XML();
xml.parseXML(miLV.xml);
}
| posted by Cay 21.03.2007 , 16:57 |
|
| Ok, I think I've found the issue. And luckily, its my fault ;)
Something that I've to keep in mind from now on:
myXML.load("scores.php?ac tion=submit_score&name="+ escape(playerName)+"&scor e="+escape(playerScore));
And then in php:
$score = urldecode($_GET["score"]) ;
:S
| posted by mr.doob 21.03.2007 , 17:23 |
|
SORRY! Is not that I don't care about what you have to say, of course I do, but they are speaking louder and I lost my patience :(
|
|
*profile

traditional id: Ricardo Cabello Miguel
based in: London, UK
serving to: Hi-ReS!
contact me: click here
*latest posts
* Some new Flash 10 Shaders for realtime... (01.09.2008) * Service Pack 3 Setup Error (31.08.2008) * FDT does work in Linux (19.08.2008) * Sorry for the delay... (19.08.2008) * Hi-ReS! Stats (11.08.2008) * Björk - Hidden Place (Knick & The Ene... (09.08.2008) * Noisia vs Religion (08.08.2008) * Inspire08 demo log, day 117 (07.08.2008) * Inspire08 demo log, day 116 (06.08.2008) * Thank you for writing to Yahoo! Accou... (01.08.2008) * Thank you for writing to Yahoo! Accou... (01.08.2008) * Definition of FAIL (31.07.2008) * Ronny Pries live @ Alpha Box Jan'08 (23.07.2008) * WALL·E (23.07.2008) * Where do we get the time from? (22.07.2008)
*latest comments
* C++, SDL Coding? Maybe.. ;) (Preview) (trace) * C++, SDL Coding? Maybe.. ;) (Preview) (Joey) * La picaresca (spt) * Mr. Slip Up (ricardo) * La picaresca (ricardo) * La picaresca (spt) * La picaresca (sole) * Demoscene @ Cirsa (sml) * La picaresca (humphr3y) * La picaresca (alfio) * fiver2's new baby: debris (Jcl) * Barcelona = full of shit(s) (Soli) * Demoscene @ Cirsa (Scener) * Rar & unrar with Ubuntu (SethPlate) * Mindcandy 2 (Jcl)
*advertising
|