[quoted text, click to view] >photographs with text; these fade in and out
fading bitmaps is cpu intensive, far better (when possible)
to place a background colored movieclip over the bitmap
and fade the movieclip, something like -
PATH = "images/";
arr=["image001","image002","image003","image004",
"image005","image006","image007"];
arr2=["A text","B text","C text","D text","E text","F text","G text"];
coord=[800,530,0,0];
waitTime = 1500; // stay at full alpha - msecs
upSpeed = 1;
downSpeed = 1;
/**************/
createEmptyMovieClip("cover",124);
with(cover){
lineStyle(1,0x000000,10); beginFill(0x000000);
lineTo(coord[0],0); lineTo(coord[0],coord[1]);
lineTo(0,coord[1]); lineTo(0,0);
_x=coord[2]; _y=coord[3]; endFill();
}
/**************/
function fader(dir){
if(dir){ loadJPG(pic); pic++;
cover.onEnterframe = function(){ coverDn();
pic > arr.length ? _level0.gotoAndStop("gam") : null; };
}else
cover.onEnterframe = function(){ coverUp();};
};
/**************/
function coverUp(){ trace("cover up");
cover._alpha += upSpeed;
if(cover._alpha > 100){
cover._alpha = 100; timer = 0; fader(1);}
};
/**************/
function coverDn(){ trace("cover down");
cover._alpha -= downSpeed;
if(cover._alpha < 0){ cover._alpha = 0; hold(waitTime);}
if(timer) fader(0);
};
/**************/
function hold(mSecs){ trace("hold");
if(!pause){
pause = getTimer() + mSecs;
} else if (getTimer() > pause){
pause = 0; timer = 1;
}
};
/**************/
function loadJPG(pic){
txt.text = arr2[pic];
createEmptyMovieClip("loadr",123);
loadr.loadMovie(PATH+arr[pic]+".jpg");
this.onEnterFrame = function(){
if(loadr._width > 0){
loadr._x = cover._x+cover._width/2-loadr._width/2;
loadr._y = cover._y+cover._height/2-loadr._height/2;
delete this.onEnterFrame;
}
};
};
pic=0; fader(1);
hth,