Hi, looked everywhere after a solution to this problem but it’s nowhere to be found.
Lets pretend that I want to write out some names from a DB and then get it with loadvars and then put it in an array for easy using later, how do I do this the best way ??
First thing first I have made an ASP file like this:
<%
Dim objConnect, objRS, SQL, strConn, i
Set objConnect = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
strConn = "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("db1.mdb")
SQL = "SELECT userFname, userEname FROM tblUser ORDER BY userFname Asc;"
i = 0
objConnect.Open(strConn)
objRS.Open(SQL), objConnect
If Not objRS.EOF Then
Do Until objRS.EOF
Response.Write("&userFname"& i &"="& objRS(0) &"&userEname"& i &"=" & objRS(1))
i = i +1
objRS.MoveNext
Loop
End If
objRS.Close: Set objRS = Nothing
objConnect.Close: Set objConnect = Nothing
%>
it generates this
[COLOR=red]&userFname0=Fröken&userEname0=Fräken&userFname1=Kalle&userEname1=Banan&userFname2=Nisse&userEname2=Ljung&userFname3=Stina&userEname3=Ljung[/COLOR]
Now I schould take this string into flash.
the basic step is this.
[AS]_root.path = “http://localhost/flashDbTest/”;
var arrNames = new Array();
var myLoadVars = new LoadVars();
myLoadVars.load(_root.path + “getInfo.asp”);
myLoadVars.onLoad = fncLoadedInfo;
function fncLoadedInfo() {
[COLOR=red]WHAT SCOULD I DO HERE ??[/COLOR]
}[/AS]
[SIZE=3]So after a lot of text en explenations the main question is, how do I loop out this thing and put it all in an array =?[/SIZE]