Can anyone tell me what the best way to have the photo gallery auto advance, maybe using the setInterval function?
It seems tedious to make a user keep pressing a button. I have had no luck…
Thanks!
Rusty
Can anyone tell me what the best way to have the photo gallery auto advance, maybe using the setInterval function?
It seems tedious to make a user keep pressing a button. I have had no luck…
Thanks!
Rusty
Just tack this on at the bottom of all the actionscript in your frame…
change = 0;
_root.createEmptyMovieClip("container", 1000);
_root.container.onEnterFrame = function() {
change++;
if (change>=70) {
_root.changePhoto(1);
change = 0;
}
};
Change the 70 to a higher or lower number to change the time it takes to change the image.
Now if you are having the buttons and where the user can use the left and right to change the picture as well you can do this…
Now to change the keyboard button press code on the frame. It is right at the end of the code. Change it to reset the change timer when a key is pressed. Like this…
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
change = 0;
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
change = 0;
}
};
You will have to do the same on the buttons if you are using them too…
on (release) {
_root.changePhoto(-1);
_root.change = 0;
}
on (release) {
_root.changePhoto(1);
_root.change = 0;
}
:: Copyright KIRUPA 2024 //--