PDA

View Full Version : passing a variable for loadmovie


TonyL
05-09-2002, 01:06 PM
Hi,

I want to pass a variable from .asp script to a flash movie for the loadmovie command. I have tried this and nothing has worked can anyone help me?

The variable is being picked up from an access db using

<%
Set Con = Server.CreateObject("ADODB.Connection")
Con.Open "dance101"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = Con
RS.Open "SELECT * FROM Chart"

imgname=RS("Image")

and then passed into flash using

loadMovie ("imgname", "Picture");

As I understand it the code above will pick up the variable (imgname) and send it to a dynamic textbox (Picture)

Am I missing something??

Thanks in advance

mad_A
05-09-2002, 02:21 PM
not sure, but I'd say it is that imgname is a variable and you are loading it as a string.
You probably want

loadMovie (imgname, "Picture");

or

loadMovie (eval(imgname), "Picture");

TonyL
05-09-2002, 03:14 PM
I don't think that Flash is picking up the asp script. It's displaying the text fine, but the "NewsPic" field stays blank.

here is the action script I'm using

loadVariablesNum ("news.asp", 0);
loadMovie (eval(imgname), "NewsPic");

and here is the asp code I'm using

<%
Set Con = Server.CreateObject("ADODB.Connection")
Con.Open "dance101"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.ActiveConnection = Con
RS.Open "SELECT * FROM News ORDER BY Dte DESC"

imgname="thejudge.swf"

Response.Write "NewsContent="

Do While Not RS.EOF

Response.Write "<b>" & RS("Title") & "</b>" & " - " & RS("Dte") & "<br>" & RS("Text") & "<br><br><br>"

RS.MoveNext

Loop

RS.Close
set RS = Nothing
Con.Close
set Con = Nothing


%>

I'm using hardcoded value in the variable for the mo', but I will be pulling the value out of the db eventually.

Any ideas? this has got me beat!