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
%>
yngviAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.