# Nice image fade effect

**URL:** <https://forum.kirupa.com/t/nice-image-fade-effect/242464>\
**Category:** Uncategorized\
**Created:** [October 26, 2007, 7:53am UTC](https://forum.kirupa.com/t/nice-image-fade-effect/242464 "2007-10-26T07:53:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PAUK](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@PAUK](https://forum.kirupa.com/u/PAUK)\
**Post date:** [October 26, 2007, 7:53am UTC](https://forum.kirupa.com/t/nice-image-fade-effect/242464/1 "2007-10-26T07:53:58Z")

</div>

How can I apply a nice image fade to my random load after the preload

AS:

* * *

fscommand(“allowscale”, “true”);

//Preload Function  
\_root.bar.\_visible = 0;  
\_root.barBorder.\_visible = 0;

MovieClip.prototype.loadPic = function(pic) {

this.loadMovie(pic);  
this.\_parent.onEnterFrame = function() {  
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();  
bar.\_visible = 1;  
barBorder.\_visible = 1;  
per = Math.round((l/t)\*100);  
if (t != 0 && Math.round(l/t) == 1 && containerMC.\_width != 0) {

bar.\_visible = 0;  
barBorder.\_visible = 0;  
loadText3.text = “”;  
delete this.\_parent.onEnterFrame;  
} else {  
bar.\_width = per \* 2;  
loadText3.text = per+" % loaded";  
}  
};  
};

//Random images  
pics = new Array(“forside\_1.jpg”, “forside\_2.jpg”, “forside\_3.jpg”, “forside\_4.jpg”, “forside\_5.jpg”);  
var randNum = getRandom(0, 3);  
\_root.containerMC.loadPic(pics[randNum], pics[randNum], 100);  
pics[randNum].\_x = 0;  
pics[randNum].\_y = 0;  
// function to generate a random integer  
// between minimum and maximum, inclusively  
function getRandom(minimum, maximum) {  
return Math.floor(Math.random()\*(maximum-minimum+1)+minimum);  
}

* * *

Any Idea 🙂
