I am trying to create a dynamic slideshow using Mysql, PHP and Flash. I have all the filenames of the images stored in the DB and then query the DB with PHP (slideshow.php) and then place the names in a variable that is comma seperated using implode in PHP so my variable shows like this when done:
files=image1.jpg,image2.jpg,image3.jpg,image4.jpg
Along with the files to be loaded I am passing the number of files and the starting index value.
//nop is the number of pictures
files=image1.jpg,image2.jpg,image3.jpg,image4.jpg&nop=4&index=0
Below is the flash code used to get that information.
onClipEvent (load)
{
var images_array = new Array();
var images_lv = new LoadVars();
images_lv.onLoad = function()
{
images_array = this.files.split(",");
};
images_lv.load("slideshow.php");
loadVariables("slideshow.php", this);
play();
}
Why do I have to use both these methods of load and loadVariables to get all the variables? I can only get the filenames with load and the other variables with loadVariables. The rest of the movie there is a MC named Slideshow and inside Slideshow there is another MC called image_slide
image.createEmptyMovieClip("slide", 0);
loadMovie("pictures/"+images_array[index], image.slide);
if (index == nop-1)
{
index = 0;
}
else
{
index++;
}
Sorry for such a lengthy post. I could really use some help here.
Thanks