View Single Post
  #2 (permalink)  
Old May 19th, 2005, 10:54 AM
harpua harpua is offline
Friend of Wrox
Points: 708, Level: 10
Points: 708, Level: 10 Points: 708, Level: 10 Points: 708, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Oklahoma City, Oklahoma, USA.
Posts: 243
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mantis
Yes this can be done, look into the LoadVars class. Below is a quick sample. The basic concept is create a LoadVars() object. When the user submits the form send the information to the server using the .load. From there you can determine when the server sends back a response using the onLoad and then use some code to determine where to send the using with a GetURL. Below is some code that I hope doesn't confuse you if it does post your questions and somebody will help.

Frame 1. -This would be your form page
stop();
var yourFormURL:String = "http://www.myDomain.com/myPHPCode.php";
var whereToGo:LoadVars = new LoadVars();

submit_btn.onRelease = function() {
    submitChoice();
};

function submitChoice() {
    var choice:Number = radioGroup.selectedData;
    poll.load(yourFormURL + "?formField1=" + choice);
    gotoAndStop("Waiting");
}

whereToGo.onLoad = returnedInfoLoaded;

function returnedInfoLoaded() {
    gotoAndStop("Display");
}

Frame 2-Waiting.
Frame with the words submitting choice....

Frame 3.
Mantis you would do something like this
    var whereToSendUser:Number = whereToGo.sendUserVarFromPHPPage;
    if (whereToSendUser < 5) {
        //send to somewhere
    } else {
        //send somewhere else
    }

Peace
Mike
http://www.eclecticpixel.com
http://www.homegrownmusicjam.com
Reply With Quote