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 ?
How To Do This Better
Moderator: General Moderators
-
dhavalshah83
- Forum Newbie
- Posts: 3
- Joined: Fri Jun 09, 2006 8:18 am
i don't know if there is a better solution, if there is 1 want to know .....
Last edited by dhavalshah83 on Fri Jun 09, 2006 8:39 am, edited 1 time in total.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
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/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.
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;have your flash movie pull in the xml from http://www.mydomain.com/xml/ and NOT http://www.mydomain.com/xml/index.php
edit: this might help, actionscript > php > mysql (simple)