View Full Version : Variable for swf to php, to load slideshow
AndyMac
December 23rd, 2008, 10:13 AM
I am working with a php programmer who has no knowledge of how Flash works. We want to use a .swf in a dynamic page on a webiste to load a slideshow. We want to use the same .swf to load different slideshows depending on which page a browser is requested. Basically this site is a tourism site and we want to allow members to upload their content and images to a MySQL database and when the page loads, a swf in their content page loads the correct images.
I can create a FLA with a placeholder which looks for an xml file to tell to where to find and load the images, but this is set up manually. I need some help (lots actually) to change the actionscript with a variable so php can read it and do its job.
Hope someone can help cos we're stuck.
joran420
December 23rd, 2008, 12:03 PM
as code.
var xml = new XML();
xml.onLoad = function(){
//dosomething
}
xml.load("phppage.php?galid=5");
PHP Code
if (isset($_GET['gal_id'])){
$q = "SELECT * FROM IMAGES WHERE gallery='".$_GET['gal_id']."'";
mysql_query($q);
}
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo "<xml>"
while($row = mysql_fetch_assoc($sql_data){
echo "<image url='$row[url]' name = '$row[name]' caption='$row[caption]' />
}
echo "</xml>
something like that....
AndyMac
December 23rd, 2008, 12:13 PM
Thank you ! I'll give this a try and let you know how it goes - I appreciate you taking the time to reply...
joran420
December 23rd, 2008, 01:00 PM
that code is not complete...and probably has some errors...just to give you an idea of how to deal with it
or when you embed your swf in your html page you could pass in a url to the xml with flashvars or just GET data
<embed src='gallery.swf?file=xml1.xml'> type of thing...
either way its gonna take some trial and error on your part
AndyMac
December 28th, 2008, 12:49 PM
Is there anyone who can solve this for me on a simple commercial basis - I need the actionscript written to work with the database. I will never do this as I am not a programmer - I need a solution quite soon... season's greetings - bye the way...
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.