  | |  | SendAndLoad Question | SendAndLoad Question 2004-02-12 - By John R. Hall
Back The following script works OK but as you can see, if you read the comments, it feels all wrong. I just want to create a generic script that returns whatever value I'm returning from the DB. Does the question make sense? Is there an approach that I might use? As always, thanks for any ideas.
function getData(tableName, studentID, varName) { formData = new LoadVars(); formData.tableName = tableName; formData.studentID = studentID; formData.variableName = varName; replyData = new LoadVars(); replyData.onLoad = myOnLoad; function myOnLoad(success) { if (success) {
// return(this.returnValue);
// return above doesn't work for me because of timing issues // I think. Setting a global variable below DOES work // but I don't want to have to have a huge list of // variables. Is there a wait loop syntax that would // allow me to return without setting a global like // I did below?
if (this.returnName == "notes") { _global.notes = this.returnValue; _level10.noteDisplay.text = _global.notes; } } else { trace("No return values from the ASP page."); } } formData.sendAndLoad(_global.dataPath+"dataGetter.asp", replyData, "post"); }
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected) For additional commands, e-mail: flashnewbie-help@(protected)
Earn $52 per hosting referral at Lunarpages.
|
|
 |