hi there… because no one reacted on my previous topics i decided to start all over again… this time i actionscripted the whole thing… let me discribe ‘the thing’ and ‘the problem’. happy reading
The thing is a kind of photogallery ( i know that there already are a lot of gallery, but i wanted to make one myself…). I want to let photo’s to fade in and to resize when loaded en to fade out when loading another one… fading in and resizing isn’t to difficult… but sometimes it won’t fade in and won’t resize… i really don’t get it. This only happens 1 out of 10 times. But when i try to intergrate the fade out it goes wrong 50% of the time… who can help me??
actionscript:
_root.finished = 100;
time = 0;
foto = new Array("foto6.jpg", "foto1.jpg", "foto2.jpg", "foto3.jpg", "foto4.jpg", "foto5.jpg");
current = 0;
function checkfadein(){
if(_level2._alpha = 0.000000000){
fadein = setInterval(fadeIn, 60);
} else
_level2._alpha = 0.000000000;
fadein = setInterval(fadeIn, 60);
}
function resizepic(){
_root.finished = 0;
_level2._alpha = 0.000000000;
checkfadein();
_level2._y = 100;
_level2._x = 100;
_level2._yscale = 20;
_level2._xscale = 20;
}
function fadeIn() {
_root.fade = "fading in";
_root.finished = 0;
_level2._alpha += 10.00000000;
if (_level2._alpha>=95) {
_root.finished = 100;
_root.fade = "faded in";
clearInterval(fadein);
}
}
function fadeOut() {
_root.fade = "fading out";
_root.finished = 0;
_level2._alpha -= 10.0000000000;
if (_level2._alpha <= 5) {
_root.fade = "faded out";
clearInterval(fadeout);
}
}
function preload() {
loadMovieNum("zwolle/"+dir, 2);
_level2._y = 500;
attachMovie("loader", "loader", 1001);
loader._y = 150;
loader._x = 300;
loaded = 0;
total = 100000;
this.onEnterFrame = function() {
total = _level2.getBytesTotal();
loaded = _level2.getBytesLoaded();
percent = (loaded/total)*100;
loader.txtpercent = Math.round(percent)+"%";
loader.balk._xscale = percent;
if (loaded>=total) {
removeMovieClip("loader");
resizepic();
delete this.onEnterFrame;
}
};
}
function changepic() {
_root.finished = 0;
if (current<foto.length-1) {
current++;
} else {
current = 0;
}
dir = foto[current];
//fadeout = setInterval(fadeOut, 60);
preload();
}
stop();
i also attached the fla… when you use it… make a folder with the name “zwolle” and put some .jpgs in the folder with the name foto1.jpg, foto2.jpg… foto6.jpg
i would really appreciate any kind of help please…