tags:

views:

59

answers:

1

Hello All
i m using flash on a module of Joomla to display images, i embed flash player code into javascript , it fetch images from an XML files wher images are predefined and it works fine, now i have a problem that i m collecting images from database, means images are dynamically, so i m unable to fetch that images an display on flash, i just want to knoe how to add dynamic image array into flash. do i need to create xml??

here is my code sample

<div id="slider"></div>
    <script type="text/javascript"> 
         var so = new SWFObject("http://localhost/projectname/modules/mod_photo_gallery2/gianniconti.swf", "slider", "942", "477", "8", "#000000");         
        so.addVariable("xml_path","http://localhost/projectname/modules/mod_photo_gallery2/gianniconti.xml"); 
        so.addParam("wmode", "transparent"); 
        so.write("slider");     
    </script>
    <?php foreach ($photos as $photo) { // $photos  containing images path ( fetch from db) ?>   
    <img src="http://localhost/projectname/components/com_user/views/images/thumbnail/&lt;?php echo $photo->thumbnail;?>" width="100" height="100">
    <?php }?>
         ......
         ......

Please help me ASAP,
Thanks

+1  A: 

if you want to avoid getting into the flash code, you would need to serve an xml to the flash player. in order to do that you can retrieve your image data from the database and use php to create an xml that you can then assign to flash via the SWFObject addVariable function

check this tutorial: http://www.kirupa.com/web/mysql_xml_php.htm

PatrickS
@PatrickS Thanks for the link
JustLearn