davidjnels
10-18-2008, 07:39 PM
Hi everyone,
I have a flash file which uses an XML file to output dynamic content. The content which is in the XML file determines what the SWF ultimately outputs (it's like a photo gallery/slideshow)
However, rather than me specifying what I want it to show, I have it on a php page and was wanting to pass a few variables into the XML file, which in turn will output the new user-generated dynamic results.
So lets say we have a php variable $photo1, and the user sets it to http://www.google.com/logo.jpg
I am wanting my XML file to be able to place that variable where I tell it to. Like this,
<?xml version="1.0" encoding="utf-8"?>
<slide_show>
<photo>{$photo1}</photo>
<photo>{$photo2}</photo>
</slide_show>
But I for the life of me cannot figure out how to pass these variables on the php page to the XML...
Here's how the XML is deployed/initiated, through a parameter in the flash embedded object which I'm using SwfObject for.
<script type="text/javascript">
swfobject.embedSWF("album.swf", "album1", "100%", "150", "9.0.0", false, {xmlfile:"album.xml", allowFullScreen:"True", loaderColor:"0xFFFFFF"}, {wmode: "transparent"});
</script>
I've tried all I can think of to get the variables across to the XML file, but every time it either results in an error with the slideshow or it simply doesnt do what its supposed to.
Can I pass it through the URL, something like the following (which didnt work)?
<script type="text/javascript">
swfobject.embedSWF("album.swf", "album1", "100%", "150", "9.0.0", false, {xmlfile:"album.xml?photo1=<?=$photo1?>&photo2=<?=$photo2?>", allowFullScreen:"True", loaderColor:"0xFFFFFF"}, {wmode: "transparent"});
</script>
Any help is greatly appreciated.
Thanks!!
I have a flash file which uses an XML file to output dynamic content. The content which is in the XML file determines what the SWF ultimately outputs (it's like a photo gallery/slideshow)
However, rather than me specifying what I want it to show, I have it on a php page and was wanting to pass a few variables into the XML file, which in turn will output the new user-generated dynamic results.
So lets say we have a php variable $photo1, and the user sets it to http://www.google.com/logo.jpg
I am wanting my XML file to be able to place that variable where I tell it to. Like this,
<?xml version="1.0" encoding="utf-8"?>
<slide_show>
<photo>{$photo1}</photo>
<photo>{$photo2}</photo>
</slide_show>
But I for the life of me cannot figure out how to pass these variables on the php page to the XML...
Here's how the XML is deployed/initiated, through a parameter in the flash embedded object which I'm using SwfObject for.
<script type="text/javascript">
swfobject.embedSWF("album.swf", "album1", "100%", "150", "9.0.0", false, {xmlfile:"album.xml", allowFullScreen:"True", loaderColor:"0xFFFFFF"}, {wmode: "transparent"});
</script>
I've tried all I can think of to get the variables across to the XML file, but every time it either results in an error with the slideshow or it simply doesnt do what its supposed to.
Can I pass it through the URL, something like the following (which didnt work)?
<script type="text/javascript">
swfobject.embedSWF("album.swf", "album1", "100%", "150", "9.0.0", false, {xmlfile:"album.xml?photo1=<?=$photo1?>&photo2=<?=$photo2?>", allowFullScreen:"True", loaderColor:"0xFFFFFF"}, {wmode: "transparent"});
</script>
Any help is greatly appreciated.
Thanks!!