Actionscript til Thumbnail Gallery
HejJeg skal have nogle billeder der ligger i et
bibliotek læst ind på en flash side under hinanden
i en kolonne....
Jeg har ud fra dette script nederst fundet frem
til et lille script. DOG virker det ikke da der
ikke kommer nogen billeder frem på baggrunden
i flash...
Det lille script skal fungere sådan her
1. variablen whichPic sættes til 1
2. så længe at billede nummer 1000 ikke er loaded
så skal der lægges en til billedfilnavnet og
dermed går man videre til næste billede...
Hvordan kan det være det ikke virker ?
whichPic=1
do {
loadMovie("../images/image"+whichPic+".jpg", "square");
whichPic ++
} while ( whichPic <1000 )
//initialize variables and properties
square._alpha = 0;
whichPic = 1;
//initiate change to new image when buttons are clicked
next.onPress = function() {
if (whichPic<5 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic++;
input = whichPic;
}
};
back.onPress = function() {
if (whichPic>1 && !fadeIn && !fadeOut) {
fadeOut = true;
whichpic--;
input = whichPic;
}
};
_root.onEnterFrame = function() {
// when a new Photo is selected, fade out, load new image, and fade in
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<10) {
loadMovie("../images/image"+whichPic+".jpg", "square");
fadeOut = false;
fadeIn = true;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
// limit input field
if (input>5) {
input = 5;
}
// initiate change to new image when Enter key is pressed
if (Key.isDown(Key.ENTER)) {
fadeOut = true;
whichpic = input;
}
};
// if a number is entered in the input field but Enter is not pressed, change
// back to current Photo number when clicking anywhere else
inputField.onKillFocus = function() {
input = whichPic;
};
