sebnewyork
05-11-2005, 04:24 AM
Hi everybody
I am trying to build a dynamic slide show in Flash and PHP.
I have the PHP side figured out:
a php script (loader.php) indexes the content of a folder (the folder containing the images) and outputs the list of images.
Then, in flash, I am using:
loadImages.onLoad = function() {
// check that totalImages has been set and sent by PHP
if (this.totalImages != undefined) {
// clear any existing values in the imagesToLoad array
imagesToLoad = new Array();
// populate the array with the images selected by PHP
for (var i=0; i < totalImages; i++) {
imagesToLoad[i] = this["image"+i];
}
}
};
// initialize variables
var loadImages:LoadVars = new LoadVars();
var imagesToLoad:Array;
// load the PHP script
loadImages.load("loader.php?ck=" + new Date().getTime());
to retreive the PHP list. Now, I don't understand that action script, but I assume it works.
The problem is, I have no idea where to go from there, that is, how to actually display the images. Are they already loaded somehow, somewehere? do I still need to load them? How would I go about loading them, at different times?
I created an MC and called it myMC, and I tried:
myMC.loadMovie(imagesToLoad[]);
this doesn't work of course... Please help!
I am trying to build a dynamic slide show in Flash and PHP.
I have the PHP side figured out:
a php script (loader.php) indexes the content of a folder (the folder containing the images) and outputs the list of images.
Then, in flash, I am using:
loadImages.onLoad = function() {
// check that totalImages has been set and sent by PHP
if (this.totalImages != undefined) {
// clear any existing values in the imagesToLoad array
imagesToLoad = new Array();
// populate the array with the images selected by PHP
for (var i=0; i < totalImages; i++) {
imagesToLoad[i] = this["image"+i];
}
}
};
// initialize variables
var loadImages:LoadVars = new LoadVars();
var imagesToLoad:Array;
// load the PHP script
loadImages.load("loader.php?ck=" + new Date().getTime());
to retreive the PHP list. Now, I don't understand that action script, but I assume it works.
The problem is, I have no idea where to go from there, that is, how to actually display the images. Are they already loaded somehow, somewehere? do I still need to load them? How would I go about loading them, at different times?
I created an MC and called it myMC, and I tried:
myMC.loadMovie(imagesToLoad[]);
this doesn't work of course... Please help!