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!

LoadVars to send info to a Database problem?

Status
Not open for further replies.

chrigil

Programmer
Sep 23, 2003
178
GB
I am trying to capture some user input and submit it to a database. I can do it successfully providing I use the second argument i.e. (_parent, _self etc).
I don't want my users to suddenly be transported from the middle of a Flash movie to a _blank page etc just because they submit their information.

How do I get the information to submit to the database without interupting the user experience?
I have posted my code below:

Code:
onClipEvent(load){
	sendScores = function(userName, userEmail, userScore){			
                myVars = new LoadVars();
		myVars.uname = userName;
		myVars.email = userEmail;
		myVars.score = userScore;
		myVars.send("submitinfo.asp");
	}
}

onClipEvent(mouseUp){
	if (this.hitTest(_root._xmouse, _root._ymouse)){
		userName = _root.uname.text;
		userEmail = _root.email.text;
		userScore = _root.score.text;
		sendScores(userName, userEmail, userScore);
	}
}

As I mentioned earlier, this code works fine providing I use the second argument although according to the documentation I should be able to leave this argument blank. I've seen loads of Flash sites give you the option of submitting info without loading the page.

Any Ideas?

Thanks in advance,

Chris
 
Well I think I found the solution. I used sendAndLoad() instead of Send().

This seems to work. If anyone knows a better way, gimme a shout.

Whenever I solve a problem on my own I'm always annoyed that I can't give myself a star [mad] , oh well never mind.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top