mysql -> flash
- Started
- Last post
- 3 Responses
- qruise
ok so..i have a mysql table, basically each row is simply a link to a URL on a webserver.
in php i can easily spit those rows out into img tags in html.
but i want to try it in flash..i want flash to load the table data and display them as movie clips...
now, im new to php & flash combining, so the only way i can think of is by making my PHP spit all the data out into some hidden DIV layer, then have flash call a javascript function...which will then set the contents of the div layer to a flash variable... and THEN have flash parse the text in the variable and proceed from there.
but that sounds slightly convoluted....is there a more elegant solution (without using XML or some shit, and without echoing it to the flash...because it will be a huge string..since its a list of urls basically..)
- kinetic0
use php to render out xml .. that way you can keep all your data in mysql but use an easily readable xml format
- jpea0
or for a more complicated way without being xml, use flash remoting/amfphp. or use swfobject and add those image path's as variables to your javascript embedded swf.
- monNom0
if you're a bit leery of XML, you could have your PHP write in the urls as a FlashVars variable within your object tag. flash will be able to reference the urls just like they were variables on the _root
http://www.adobe.com/cfusion/kno…
this gets a bit messy with a lot go data. I'd recommend checking out some tutorials on XML parsing within flash. once you get a feel for how the framework is set up, it's a piece of cake. and the php->xml portion is no different than php->html