-
LoadVars not receiving
Hi,
I'm having trouble get LoadVars to detect when the data has been sent back from the server to it.
The demo is:
http://www.inflash.com/quiz/test.html
when the Submit Data button is pressed, this is called:
http://www.inflash.com/quiz/test.php
the php script is:
print "Content-type: application/x-www-urlform-encoded\n\n&";
print "feedback=$test_id&server=done";
and the Flash actionscript is:
function submitData(){
varSender.test_id=123;
r_num=random(100000);
varSender.sendAndLoad("http://www.inflash.com/quiz/test.php?r="+r_num, varReceiver, "GET");
gotoAndPlay(2);
}
varReceiver.onLoad=function(){
gotoAndStop(5);
}
varSender = new LoadVars();
varReciever = new LoadVars();
stop();
It just loops without stopping. Any thoughts?
-
Hi,
wouldn't the sending object's onload function be triggered?
Musicman
-
hmm. looks like i spelt receiver wrong. lemme try again.
-
I dropped the varReceiver.onLoad function and instead put in frame 5:
Code:
if (varReceiver.server=="done"){
stop();
}else{
gotoAndPlay(2);
}
which works
-
the varReceiver.onLoad must come after varReceiver=new LoadVars();
woops
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|