I have a group of thumbnails on my main swf. I wanted to have a gallery with full size pictures open up in a new window. I liked the sbeener photo gallery script except that it will only load the first picture in the array when the gallery swf opens. I am trying to customize the script so that a different picture is loaded as the initial image depending on which thumbnail on the main swf is clicked to launch the gallery swf. Each thumbnail has the following action script:
on (release) {
getURL (“javascript:NewWindow=window.open(‘gallery.php?sp=6’,‘newWin’,‘width=504,height=504,left=300,top=100,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No’); NewWindow.focus();void(0);”);
}
The only difference is that each thumbnail is passing a different value for the variable sp. I then changed sbeener’s actionscript lines 14 to 18 in the gallery swf from:
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
to:
this.pIndex = sp;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[this.pIndex], _root.photo);
The rest of the script I left the same, except I commented out the keyboard commands at the bottom. My gallery swf includes a forward and back button as described in the tutorial. My effort almost works. The proper photo loads initially so I know that my sp variable is being passed properly. The problem is that the first time one of the buttons is clicked, the pIndex variable does not increment or decrement as expected. In all cases the back button results in NaN. The forward button jumps to an out of order photo. Second and subsequent clicks on either button behave as expected. You can observe my results at: http://2000marketstreet.net by clicking the Gallery Button, then any of the thumbnails in the first gallery. I also uploaded my .fla file to: [URL=“http://2000marketstreet.net/gallery.fla”]http://2000marketstreet.net/gallery.fla
I have tried to provide as much information as possible as to my problem. I would reallly appreciate any help available.