Page 1 of 1

How To Do This Better

Posted: Fri Jun 09, 2006 8:22 am
by dhavalshah83
I am currently woring on a project wich involves Flash, XML, MySql, PHP. I have to populate flash map with countries & upon clicking cities from the database.

But the thing is the cities can keep on changing, some may be deleted & new ones can be added. So the solution i have developed revolves around rewriting the city.xml when a country is clicked.

Is there a better solution, something that will directly pass values to the flash file without writing to the file itself & save me some valuble I/O time ?

Posted: Fri Jun 09, 2006 8:29 am
by feyd
PHP script that renders in XML?

Posted: Fri Jun 09, 2006 8:32 am
by dhavalshah83
i don't know if there is a better solution, if there is 1 want to know .....

Posted: Fri Jun 09, 2006 8:34 am
by feyd
Having a php script render the XML wouldn't require it writing to a file. If you're going to update the XML data every request, there's no reason to have a static file is there? So a PHP script that renders to XML is more ideal. As for the "perfect" solution, it's the only one you have an option for in this case.

Posted: Fri Jun 09, 2006 8:58 am
by nathanr
feyd wrote:Having a php script render the XML wouldn't require it writing to a file. If you're going to update the XML data every request, there's no reason to have a static file is there? So a PHP script that renders to XML is more ideal. As for the "perfect" solution, it's the only one you have an option for in this case.
indeed you can simply do the following: create a folder http://www.mydomain.com/xml/
have an index.php within that folder that outputs xml on the fly
output the xml from the file as such

Code: Select all

header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="ISO-8859-1"?>';
echo $xml;
this method makes sure all browsers and apps can recognise its xml

have your flash movie pull in the xml from http://www.mydomain.com/xml/ and NOT http://www.mydomain.com/xml/index.php

8O [ or just use javascript to get the values via ajax and pass the values to the movie, or intensive action script to pull in the info directly]

edit: this might help, actionscript > php > mysql (simple)

Posted: Mon Jun 12, 2006 4:10 am
by dhavalshah83
thanx for the help .. !!! :D