A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Help with LoadVars()/sendAndLoad() in my form

Hybrid View

  1. #1
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    you're close. you want to make two loadVars - outgoingVars and incomingVars (those are names i made up). then, you put anything you want to send out in outgoingVars:

    outgoingVars.buttonPressed = "pestcontrol";

    here's an example of send and load - sending vars to serverside scripting (php, asp, cf) just like an html form would do with a form submit.

    Code:
    //
    function doSend(){
    	outgoingVars.sendAndLoad("flashForm.aspx",incomingVars,"GET");
    	gotoAndPlay("submitted");
    	}// function
    //
    //
    incomingVars.onLoad = function(success) {
    	gotoAndPlay("received");
    }
    //
    here outgoingVars are sent to an asp page that handles form submissions called "flashform.aspx". that flashform.aspx will receive everything i put in outgoingVars. you could put your whole form in flash with what you know.

    the onLoad function will happen when your outgoingVars are delivered (instantly usually).

    gotta go. hope that gets you going.

  2. #2
    Confounded Flash User
    Join Date
    Apr 2001
    Location
    Chicago
    Posts
    39
    Right now I'm only using a simple HTML page, no server side scripting. I'm just picking off the GET vars of the URL with JavaScript. In any event, I added the code Moot supplied (thanks) but nothing changed. My script does not see the "buttonPressed" var.

    So right now I have this:

    Code:
    outgoingVars.buttonPressed = "pestcontrol";
    
    function doSend(){
    	outgoingVars.sendAndLoad("self2.html",incomingVars,"GET");
    // wouldn't the above be ("self2.html",outgoingVars,"GET")? doesn't work either way
    	gotoAndPlay("submitted");
    	}
    
    incomingVars.onLoad = function(success) {
    	gotoAndPlay("received");
    }
    with this still on the button
    Code:
    on (release) {
    	getURL("javascript:flashFormSubmit();");
    }
    I'm confused about the gotoAndPlay() method here - my movie is nothing more than a button - why would it want to go anywhere? Also, my movie need not receive anything back at all - I just need to make the "pestcontrol" variable available to the form, actually in post form eventually, but get will work for now. Sorry about being dense, but I don't understand the process of how Flash sends over stuff so I can't seem to wrap my head around this

    Tom

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