Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing variables to ASP page using POST method

Status
Not open for further replies.

cic

Technical User
Apr 12, 2001
28
US
Flash is new me. I am having problems getting my Flash form to work with my ASP page. I am using

LoadVariables("Insert.asp","0","POST")

To communicate with my ASP page, but nothing is happening. The rest of my code it below. Can someone help me out?

on (release) {
var LastIncumbent;
LastBid.text = WinningBid.text;
FirstPreRound.text = LastRound.text;
LastRound.text = math.round(math.random()*14000)+33000;
LastHouseBid.text = WinningBid.text*(1+(math.round(math.random()*2)-1)/10);
LastPlayerBid.text = WinningBid.text*0.90;
LastIncumbent = Incumbent.text;
Incumbent.text = "House";
WinningBid.text = LastHouseBid.text;
if (Number(LastHouseBid.text) == Number(LastPlayerBid.text) && LastIncumbent == "Player") {
surplus.text = Number(LastPlayerBid.text)-LastRound.text+Number(surplus.text);
Incumbent.text = "Player";
WinningBid.text = LastPlayerBid.text;
}
if (Number(LastHouseBid.text)>Number(LastPlayerBid.text)) {
surplus.text = Number(LastPlayerBid.text)-LastRound.text+Number(surplus.text);
Incumbent.text = "Player";
WinningBid.text = LastPlayerBid.text;
}
Surplus = surplus.text
LoadVariables("Insert.asp","0","POST")

}
 
Are you just trying to process the variables or are you getting returning variables to the flash movie from the ASP?

Wow JT that almost looked like you knew what you were doing!
 
I am trying to process the variables.
 
If you are just handing it off to the ASP page I would use getURL("Insert.asp","windowName",POST);

If you want to send it to the ASP page and not leave the flash movie you will need to use LoadVars.SendAndLoad()

Hope that helps.

Wow JT that almost looked like you knew what you were doing!
 
Thanks for your help. I have on more questions. I have been trying to figure out how to set up the LoadVars.SendAndLoad().

On a website it showed me how to format it.

LoadVars.SendAndLoad(url,targetObject[,method])

My question is what do I enter in for targetObject?

Thanks again
 
The LoadVars that you want the variable(s) to be passed into. For example (on submit button):

on(release){
myVars = new LoadVars();
myVars.name = _root.name; // _root.name is form field
myVars.onLoad = function(ok){
if (ok){
trace("I have data!");
_root.Reply.text = myVars.reply; //_root.reply is dynamic text box instance name "reply". myVars.reply is coming back from the form processor (name/value pairs)
}
}
myVars.sendAndLoad("yourFormProcessor.asp", myVars, "POST"); // myVars is the target loadVars object.
}

Good Luck!

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top