Skip Photo

Hi

I’m using the photogallerytutorial, I set up the gallery and everything works fine. You can set the buttons at

on (release) {
_root.changePhoto(1);
}

How can I control this from the keyframe before the photgallery, so wich action do I have to give to a button to go to the 3rd picture in the photogallery. (I’m showing tumbnails first and if they click on them they go directly to the large photo in the photogalery)

Thnx

After looking at the actionscript for a minute, it seems the current picture it is on is the variable pIndex (correct me if I’m wrong :slight_smile: ). All you would have to do is subtract the number of the thumbnail they clicked on from the current one to figure out the difference. Once you do that, you can assign the action to you’re thumbnail buttons, and that should be it :).

Here’s the actions to add to the thumbnail button, where thumbNum is the number of the picture you want to go to.


on (release) {
thumbNum = 3;
dif;
 if(yourSlideshow.pIndex < thumbNum)
  {dif = thumbNum - yourSlideshow.pIndex ;}
 else {dif = yourSlideshow.pIndex - thumbNum;}

_root.changePhoto(dif);	
}

don’t go by this, however, i’m just explaining the concept. I didn’t look at the tutorial long enough to make sure that this would work, and I’m very well known to make careless mistakes :slight_smile: Let one of the experts correct my code :slight_smile:

u know the array where the filenames of the pictures are? ok, the 1st picture is numbered 0. the 2nd picture is numbered 1, the 3rd picture is numbered 2 and so on…

remember the actions of the button?
on(release){
changePhoto(1);
}

and

on(release){
changePhoto(-1);
}

well, on the thumbnail button, change the number in changePhoto(number) to the number of the picture in the array. as i’ve said, the first picture is numbered 0, the last picture is numbered (totalNumberOfPictures-1).

remember this function?
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;
};

this is the changePhoto function, change it to this:

MovieClip.prototype.changePhoto = function(d) {
this.pIndex = d;
this.onEnterFrame = fadeOut;
};

i hope i didn’t get things messed up. i really am not that good in teaching. :stuck_out_tongue:

Thanx, I tried it but the thumbnails aren’t on the same frame as the photomovieclip and the actionscript for the gallery.
So maby you can take a look at IT

i checkd ur FLA…hmm…the thumbnails are on the next frame but on the 2nd frame, there are 3 more buttons, the previous, go back to thumbnails and the next…that made me think…hmmm…

What do you mean? Isn’t it possible? Does it work with what you said in the other post? Is it stupid?