dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: LoadVars not receiving

  1. #1
    Senior Member
    Join Date
    Mar 2000
    Posts
    584

    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?
    InFlash.com shows, games, greetings and more - you in?

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    wouldn't the sending object's onload function be triggered?

    Musicman

  3. #3
    Senior Member
    Join Date
    Mar 2000
    Posts
    584
    hmm. looks like i spelt receiver wrong. lemme try again.
    InFlash.com shows, games, greetings and more - you in?

  4. #4
    Senior Member
    Join Date
    Mar 2000
    Posts
    584
    I dropped the varReceiver.onLoad function and instead put in frame 5:

    Code:
    if (varReceiver.server=="done"){
    	stop();
    }else{
    	gotoAndPlay(2);
    }
    which works
    InFlash.com shows, games, greetings and more - you in?

  5. #5
    Senior Member
    Join Date
    Mar 2000
    Posts
    584
    the varReceiver.onLoad must come after varReceiver=new LoadVars();

    woops
    InFlash.com shows, games, greetings and more - you in?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center