Photo gallery modify

hi all,
i’m modifying the photo gallery tutorial on this sit to suit me and i’ve got some questions on how best to modify it and also on how it works.

  1. Firstly if I’m using the ten images supplied in the tutorial and i activate the SWF to load tutorial, do the images load 1 at at time or will i wait for the ten to load at once?

  2. in either case, if say images load 1 by 1 and the image is 50K
    how can i add a pre-loader to each image so I’m not staring at a blank screen waiting for each image to pop up?

  3. also, how can I modify the code to make it go to image 4 first,
    for eg, I have 10 thumbnail images in my main SWF, i want to click on thumb 5 button so it goes to image 5 in the gallery SWF instead of image 1 which it is doing, and then have the forward button go to image 6 etc, and the back button go to image 5 etc…

code…that’s used

i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it
easier to understand.
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. “pics/”)
// leave it blank if they’re in the same directory
this.pathToPics = “animation/”;
// fill this array with your pics
this.pArray = [“image0.jpg”, “image1.jpg”, “image2.jpg”, “image3.jpg”, “image4.jpg”, “image5.jpg”, “image6.jpg”, “image7.jpg”, “image8.jpg”, “image9.jpg”, “image10.jpg”];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
this.onEnterFrame = fadeOut;
MovieClip.prototype.fadeOut = function() {
if (>this.fadeSpeed) { -= this.fadeSpeed;
} else {
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p =;
p._alpha = 0;
this.onEnterFrame = loadMeter;
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l =;
t =;
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
MovieClip.prototype.fadeIn = function() {
if (<100-this.fadeSpeed) { += this.fadeSpeed;
} else { = 100;
this.onEnterFrame = null;
// Actions -----------------------------------------
// these aren’t necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
} else if (Key.getCode() == Key.RIGHT) {

gallery doesn’t work when I upload it…

_in the photo gallery SWF,

this.pathToPics = “”;

all i get is the SWF with no images, is the above code correct,
do I need an ‘index html’ page with the photo gallery SWF even though it’s loaded externally from my main SWF?

all help appreciated, thanks.

Would any one know how to format the flash code to load the image names from a external PHP or Text file so that the Image Gallery project will become more flexible?

The code use in the modified code is like:
this.pArray = [“image0.jpg”, “image1.jpg”, “image2.jpg”];

How can I modify the code to load names from a external file as an array?