Hello, I have a list box (named "myName"
on the main stage with items in it, there is also a dynamic text box named "display". I'm trying to select an item in the list box and have the dynamic text box display database values relating to that item. I'm using ASP and have the server side aspect done. The ASP page takes write a variable string to send back to Flash and then the response.write sends the name and value pairs to the page so flash can get them.
The flash movie is just 1 frame and i have these actions on it own layer
I've tried to fool around with this and the else statement ("No Entries."
is the only thing i can get to display. Any ideas why this may be?? Please Help
Here's part of the ASP code:
The flash movie is just 1 frame and i have these actions on it own layer
Code:
myName.setChangeHandler("myHandler");
//Custom handler for myName
//This handler is called each time selection is
//changed.
myHandler = function (component) {
myVars = new LoadVars();
myVars.curName = myName.getSelectedIndex()+1;
myVars.onLoad = displayInfo;
myVars.sendAndLoad("wpg.asp", myVars);
};
//Extracts db info and displays it using HTML
displayInfo = function () {
display.htmlText = "";
myTotal = this["total"];
if (myTotal != 0) {
display.htmlText += "<font color=\"#999999\" size=\"11\"><b>There are <font color=\"#CC6600\"><i>"+myTotal+"</i></font> entries for this month</b></font><br>";
for (var i = 0; i<this["total"]; i++) {
display.htmlText += "<font color=\"#CC6600\" size=\"11\"><b>"+this["myName"+i]+"</b></font><br>";
display.htmlText += "<font size=\"11\"><b>"+this["myAddress"+i]+"</b></font><br>";
display.htmlText += "<font size=\"11\">"+this["myPhone"+i]+"</font><br><br>";
}
} else {
display.htmlText += "<b>No Entries.</b>";
}
};
I've tried to fool around with this and the else statement ("No Entries."
Here's part of the ASP code:
Code:
Dim curName, responseVars, counter
curName = Request ("curName")
counter = 0
Set connDB = Server.CreateObject("ADODB.Connection")
connDB.Open "DBQ=" & Server.MapPath("\menu\wegmnu.mdb") & ";" & _
"DRIVER=Microsoft Access Driver (*.mdb)"
sql = "SELECT * FROM rerans WHERE [name] = '"&curName&"'"
Set rs = connDB.Execute(sql)
while not rs.eof
responseVars = responseVars & "name" & counter & "=" & rs("name") & "& address" & counter & "=" & rs("address") & "& phone" & counter & "=" & rs ("phone") & "& cusine" & counter & "=" & rs ("cusine") & "& eat" & counter & "=" & rs ("eat") & "& menu" & counter & "=" & rs ("menu")
counter = counter + 1
rs.movenext
wend
responseVars = responseVars & "total=" & counter
Response.Write(responseVars)
set rs = nothing
....