Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2004
    Location
    Nashville
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Having Trouble with gotoAndStop after loadVariables

    Greetings,

    I've got a form with 3 "steps" and I want to submit each step at a time.

    Everything is working fine but I'm unable to successfully call both of these functions at once:

    on(release) {
    form_1.loadVariables("post.php", "POST");
    gotoAndStop(2);
    }


    I have the above function inside my "button" that is successfully going to the next frame (2) but it's not posting. If I remove gotoAndStop(2) it SUCCESSFULLY submits the form.

    Any idea what I'm doing wrong?

    Thanks

    jw

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I think the post is taking longer than it takes to go to the next frame. You can try putting a setTimeout on the gotoandstop or if you can some how check to see if loadVariables is done posting. I don't know how you can do this.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    Nashville
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    Hey Aero,

    Thanks for your help. I took your suggestion and figured out something that works fine. I attached the below code to my form button:

    Code:
    on(release) {
    	
    	function moveOn() {
    		gotoAndStop(2);
    	}
    	
    	form_1.loadVariables("post.php", "POST");
    	setTimeout(moveOn, 1000);
    	}
    Thank You


  •  

    Posting Permissions

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