ekko
06-20-2005, 05:12 AM
Here is a link to the asp file:
http://d415899.u53.fluidhosting.com/LoadForFlashArray.asp
ASP Code:
<!-- #include file="include.asp" -->
<%
dim con
dim rst
dim count
set con = getconnection
set rst = server.CreateObject ("ADODB.recordset")
rst.activeconnection=con
rst.source = "select * from tblappetizerrecipe"
rst.Open
count = 0
while not rst.EOF
call Response.Write "&id" & count & "=" & rst("recipeID")
call Response.Write "&name" & count & "=" & rst("recipename")
count = count + 1
call rst.MoveNext
wend
call Response.Write "&count=" & count
call rst.Close
set rst = nothing
call con.close
set con = nothing
%>
Here is my actionscript:
myVars = new LoadVars();
myVars.onLoad = function(success){
if(success){
for(i=0; i<this.count-1; i++){
ids[i] = this["id" + i];
names[i] = this["name" + i];
}
}
}
myVars.load("LoadForFlashArray.asp");
Now when I set a text area's variable in the properties pane to something like ids[0] or names[1] nothing shows up. However, if I would pull a non-array variable like "count" in and make that the variable for the text field it works fine (in other words single variables work, arrays don't). For example:
myVars = new LoadVars();
myVars.onLoad = function(success){
if(success){
for(i=0; i<this.count-1; i++){
ids[i] = this["id" + i];
names[i] = this["name" + i];
loopCount = this.count;
}
}
}
myVars.load("LoadForFlashArray.asp");
In the above example if I assign "loopCount" to the textfield variable field the ASP "count" variable displays properly, but I still can't get the arrays to display.
Any ideas? Can you not just assign an array directly to a text field?
Thanks
http://d415899.u53.fluidhosting.com/LoadForFlashArray.asp
ASP Code:
<!-- #include file="include.asp" -->
<%
dim con
dim rst
dim count
set con = getconnection
set rst = server.CreateObject ("ADODB.recordset")
rst.activeconnection=con
rst.source = "select * from tblappetizerrecipe"
rst.Open
count = 0
while not rst.EOF
call Response.Write "&id" & count & "=" & rst("recipeID")
call Response.Write "&name" & count & "=" & rst("recipename")
count = count + 1
call rst.MoveNext
wend
call Response.Write "&count=" & count
call rst.Close
set rst = nothing
call con.close
set con = nothing
%>
Here is my actionscript:
myVars = new LoadVars();
myVars.onLoad = function(success){
if(success){
for(i=0; i<this.count-1; i++){
ids[i] = this["id" + i];
names[i] = this["name" + i];
}
}
}
myVars.load("LoadForFlashArray.asp");
Now when I set a text area's variable in the properties pane to something like ids[0] or names[1] nothing shows up. However, if I would pull a non-array variable like "count" in and make that the variable for the text field it works fine (in other words single variables work, arrays don't). For example:
myVars = new LoadVars();
myVars.onLoad = function(success){
if(success){
for(i=0; i<this.count-1; i++){
ids[i] = this["id" + i];
names[i] = this["name" + i];
loopCount = this.count;
}
}
}
myVars.load("LoadForFlashArray.asp");
In the above example if I assign "loopCount" to the textfield variable field the ASP "count" variable displays properly, but I still can't get the arrays to display.
Any ideas? Can you not just assign an array directly to a text field?
Thanks