PDA

View Full Version : How to get MySQL into Flash using PHP / XML?


michaelmorris
12-24-2006, 04:05 PM
Ok.

I am looking for a way to create a banner which gets certain information from a MySQL database. My origional thought pattern was this:

1-Get data from MySQL databse using PHP
2-Put it into an XML doc
3-Put the XML into flash

But then I though a) Can you even do that? and b) How do I get XML into Flash.

So then I though well what about putting it into Flash using PHP.

So what I want to do is call info from a database (called 'database') and table (called 'table') with fields 'id','title','cont',and 'img'. (There will be 5sets of data/records)

Now I want each record to be displayed on a seperate frame (so id=1 on fram 1 etc)

I will then animate it etc.

Can this be done? If so how?

Thanks alot (I know this is a tough one (well i think it is))

xD Michael

edit: I'm using Flash 8 Pro

ablaye
12-25-2006, 03:40 AM
I was looking for something similar to this. I am curious to know the answer to this.

Billy T
12-25-2006, 12:17 PM
http://www.hed.swinburne.edu.au/design/tutorials/flash/flashdb/index.php

basic concept is this:

create a loadvars object in flash

call a load() on that object that loads a php script

the php script connects to the database, runs the query and sends the vars back to flash

michaelmorris
12-25-2006, 12:53 PM
thanks!!!! xD

mooska
12-25-2006, 11:34 PM
Using LoadVars for retrieving data from sql is bad ;) and a bit complicated, search for amfphp or other flash Remoting technologies

am_i_troubleshooter
01-02-2007, 03:52 AM
Using LoadVars for retrieving data from sql is bad ;) and a bit complicated, search for amfphp or other flash Remoting technologies

I don't agree with you. The aim is to retrieve certain information from the sql, why is it bad? It's not like a chat or something that needs retrieval every few seconds or so.

DilutedImage
01-02-2007, 08:04 AM
Follow this tutorial to get your data into Flash:

http://www.adobe.com/devnet/flash/articles/flash_xmlphp.html

Then do whatever you want with that data in Flash.


mooska
01-02-2007, 08:53 AM
I don't agree with you. The aim is to retrieve certain information from the sql, why is it bad? It's not like a chat or something that needs retrieval every few seconds or so.

Parsing on both serverside and clientside is bad, remoting lets you do this (type preservation) transparently, without those strange string operations or creating and parsing xml. Sending whole sql table is much easier, try it, youll know what I mean.

and more, its not used for simultaneus connections (retrieving data every few seconds) you talk about some xmlSocket servers i guess