I have 3 jpegs which are loading into a main movie with and alpha fade in using actionscript. I thought this was all I was looking for with these (because someone helped me get through that) but it turns out that once they are fulled faded in, I would like them to fade back out slowly. Here is the original code:
_root.createEmptyMovieClip("holder2", 17);
holder2._x = 555;
holder2._y = 112;
function loadIn(movie) {
clearInterval(loadInterval);
holder2.loadMovie(movie);
holder2._alpha = 0;
var temp = _root.createEmptyMovieClip("tmp", 18);
temp.onEnterFrame = function() {
var a = holder2.getBytesLoaded();
var b = holder2.getBytesTotal();
if (b == a && b>4) {
holder2._alpha += 4;
if (holder2._alpha>100) {
holder2._alpha = 100;
delete this.onEnterFrame;
}
}
};
}
loadInterval = setInterval(loadIn, 1050, "intro1.jpg");
_root.createEmptyMovieClip("holder3", 19);
holder3._x = 191;
holder3._y = 112;
function loadIn2(movie) {
clearInterval(load2Interval);
holder3.loadMovie(movie);
holder3._alpha = 0;
var temp2 = _root.createEmptyMovieClip("tmp2", 20);
temp2.onEnterFrame = function() {
var c = holder3.getBytesLoaded();
var d = holder3.getBytesTotal();
if (d == c && d>4) {
holder3._alpha += 4;
if (holder3._alpha>100) {
holder3._alpha = 100;
delete this.onEnterFrame;
}
}
};
}
load2Interval = setInterval(loadIn2, 2050, "intro2.jpg");
_root.createEmptyMovieClip("holder4", 21);
holder4._x = 0;
holder4._y = 112;
function loadIn3(movie) {
clearInterval(load3Interval);
holder4.loadMovie(movie);
holder4._alpha = 0;
var temp3 = _root.createEmptyMovieClip("tmp3", 22);
temp3.onEnterFrame = function() {
var e = holder4.getBytesLoaded();
var f = holder4.getBytesTotal();
if (f == e && f>4) {
holder4._alpha += 4;
if (holder4._alpha>100) {
holder4._alpha = 100;
delete this.onEnterFrame;
}
}
};
}
load3Interval = setInterval(loadIn3, 3050, "intro3.jpg");
I have been trying on my own (and with any info I have found on forums) to modify this code so that once it reaches full alpha (100%) it will fade back out to zero. I was only using the last function which loads intro3.jpeg and this is what I have as of right now:
_root.createEmptyMovieClip("holder4", 21);
holder4._x = 0;
holder4._y = 112;
function loadIn3(movie) {
clearInterval(load3Interval);
holder4.loadMovie(movie);
holder4._alpha = 0;
var temp3 = _root.createEmptyMovieClip("tmp3", 22);
temp3.onEnterFrame = function() {
var e = holder4.getBytesLoaded();
var f = holder4.getBytesTotal();
if (f == e && f>4) {
holder4._alpha += 4;
if (holder4._alpha>100) {
var g = holder4.getBytesLoaded();
var h = holder4.getBytesTotal();
if (g == h && g<4) {
holder4._alpha -= 4;
if(holder4._alpha=0){
delete this.onEnterFrame;
}
}
}
}
};
}
load3Interval = setInterval(loadIn3, 3050, "intro3.jpg");
But this does not create a slow fade it simply goes to zero alpha once alpha reaches 100%. Any suggestions as to the steps am I missing?