Hello,
In the photogallery that I have, the button 12 and 13 don’t work. It does not load image 12 and 13. I :{ have spend a lot of time to debug it but I do not see why it does not work.
You can download the Flash file from www.parkstkdacademy.com/gallery-loader.zip
Basically, each button has the actionscript below:
-For image 1 -> on(rollOver) {
controller.setActive(1);}
-For image 2 -> on(rollOver) {
controller.setActive(1);}
…
-For image 13 -> on(rollOver) {
controller.setActive(13);}
This is the main actionscript:
onClipEvent(load) {
// anti-irritation measure
fscommand("allowscale","false");
// set the number of images you're using
// (they should be named image1, image2, etc)
var numImages = 13;
// set the default image
var defaultImage = Math.floor(1+Math.random()*numImages);
// fading speed; 0 is forever, 1 is immediate
var fadeSpeed = 0.20;
// the timer lets us stop the procedure after a certain number of frames
var timer=0;
// Do some initial setting-up to each image
var images = new Array();
for (var i=0; i<numImages; i++) {
// it's quicker if we reference them all from an array
images* = _root["image"+(i+1)];
// make all alphas 0 initially
images*._alpha = 0;
// set a variable called 'targetAlpha' in each
images*.targetAlpha = 0;
}
// function to set the active image
function setActive(image) {
// set the target alpha of the active image to 100,
// and the target alphas of the others to 0.
for (var i=0; i<numImages; i++) {
if (i+1 == image) {
images*.targetAlpha = 100;
} else {
images*.targetAlpha = 0;
}
}
// turn on the enterFrame function
doStuff=eF;
// reset timer
timer=0;
}
// this will happen every frame the movie is active
function ef() {
// for each image
for (var i=0; i<numImages; i++) {
// move the alpha of the image closer to that image's target alpha
images*._alpha += (images*.targetAlpha - images*._alpha) * fadeSpeed;
}
// if it's been active for >30 frames, stop the enterFrame behaviour
if (timer++ > 30) {
doStuff = null;
}
}
// start with the default image
setActive(defaultImage);
}
onClipEvent(enterFrame) {
doStuff();
}
Thank you very much for helping me out.