Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database 3

Status
Not open for further replies.

Shosh

IS-IT--Management
Mar 19, 2004
11
CA
How can I connect to an SQL server and retrieve data?
Can it be done right from Flash MX?
If it can not be done from flash what is the best method to create some connecting between the two applications (Flash MX and SQL)?

Thank you
Assaf
 
You must use some kind of server-side scripting to do this with Flash - but it can definately be done. Do a keyword search here on database and you'll get at least 20 responses. Also, check the help files in the Actionscript section of your program - there's lots of stuff there, also.

There's always a better way. The fun is trying to find it!
 
The Flash end of this problem can be handled using LoadVars() which is an object set up to communicate with the serverside script.

This script can be written in a variety of languages (PHP, ASP and ColdFusion are probably the most common).

This script contains the query that is run on the database, retrieves the result and sends it back to Flash.

Actually, since this is such a common question I'm going to put together an FAQ for it...
 
I've put the FAQ up - it should give a basic framework for communicating with serverside scripts.
 
Hi wangbar,
Thanks a lot for the FAQ but where is it?
What's the title?

Thanks
Assaf
 
In the FAQ section under 'Step by Step Tutorials'. It's actually not all that 'step by step' but it has some example scripts and explanations - it didn't seem to fit anywhere else though.
 
wangbar, i downloaded the dbaccess.fla from your faq-subject but my flash says it cant open the document. im using flash 5, i dunno if theres that much difference between all the versions of flash? in any case if you could put up a flash5-working version of your file itd really help me out, thanks =]

klaas
 
It's an MX file which is using the LoadVars() object. This object doesn't exist in Flash 5 I'm afraid - you can try adapting it using loadVariables instead which does work in Flash 5 (I don't have time to do that for you) and use the same PHP script which will work the same regardless of which version of Flash you're using.
 
the whole file wouldnt open in flash5, so i didnt get the chance to change anythin. but nvrmnd, i got flashmx installed now and it does open in that one. thanks again, this is a great tut.

klaas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top