• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Getting information from ASP

I need my flash movie to get information from a database. I use asp file to get the information but how do I access the asp file to get the information into a textfield in Flash ?

This is my ASP file :

<% @Language=VBScript %>  
 
<%
sqlString = "select * from score"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver=SQL Server;server=192.168.1.5;uid=sa;pwd=;database=bowling;"
Set res = conn.Execute(sqlString)
Set score = res("frame1")
Response.Write("text="+score)
conn.Close
%>
0
yngvi
Asked:
yngvi
1 Solution
 
SuperMarioCommented:
Flash can get parameters from any object using Generator, and also I think there are ways to retrieve values. I'll get back to you with this one...

-Dan
0
 
nobiusCommented:
First of all please excuse typos :-)

Hi!

I'm not sure how you are attempting to do this.  First of all, are you using flash generator?  If so then like SuperMario said, you can pass flash parameters from your ASP page.  You can pass those values to Flash template file through the query string. (ie "flashfile.swf?YourVariable=TheValue&YourVariable2=TheValue2").  Using this method you can pass as many values as you need to the flash movie.  If this is the option you are using and need more detail, comment back.

If you are not using generator, then you will need to use asp to read your data from your DB and then to write that data to a text file.  Your Flash movie will then need to read data from that text file.  If this is the option you are using and need more detail, comment back.

Hope this helps.
0
 
yngviAuthor Commented:
I just solved the problem by my self... There is an option to read from location in Flash so I just pointed the location to a ASP file. Also I have to make the asp file write out an value like this  text=value then the label in the flash movie has to have the same label as the output of the ASP file. The label would then be "text"
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
nobiusCommented:
That is what I said in the 2nd part of my answer.  Can I get some points?
0
 
kikkertmCommented:
The answer is actually not that difficult, it's already there !

When you like to get a value into a movie (let's say it's called 'movie1.swf') you can just append it as being an argumant past with 'get' in ASP. The code would look like this :

<% @Language=VBScript %>  
 
<%
sqlString = "select * from score"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver=SQL Server;server=192.168.1.5;uid=sa;pwd=;database=bowling;"
Set res = conn.Execute(sqlString)
Set score = res("frame1")
conn.Close
%>

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
<PARAM NAME=movie VALUE="movie1.swf?text=<%response.write score%>"> </OBJECT>

So you dynamicly write your resulting recordset as an argument to the movie.
Then in the first frame of the movie (or where ever you need the variable) you add an action to a frame that sets an internal variable to the variable 'text' like

set variable : "intText" = text

where intText is the variable of a textfield.

I used this a couple of times and it works fine. You can even use a data-acces DLL in combination with the ASP scriptingcontext to write back much more complicated queriestrings but the solution above will do for small strings..

Goodluck !!

Mike One







0
 
juanrCommented:
nobius

You said the first option only works with flash generator. I'm not sure if I have flas generator.
If a post a new question, can you tell me more about the second option ? ?
Thanks...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now