# Randomly fade pictures in and out

**URL:** <https://forum.kirupa.com/t/randomly-fade-pictures-in-and-out/49579>\
**Category:** Uncategorized\
**Created:** [April 24, 2004, 12:41am UTC](https://forum.kirupa.com/t/randomly-fade-pictures-in-and-out/49579 "2004-04-24T00:41:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pneumonic](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pneumonic](https://forum.kirupa.com/u/Pneumonic)\
**Post date:** [April 24, 2004, 12:41am UTC](https://forum.kirupa.com/t/randomly-fade-pictures-in-and-out/49579/1 "2004-04-24T00:41:47Z")

</div>

What I’m trying to do is this. I want to fade pictures in and out, but randomly. Kinda like KrazyDad’s cloud fly through. I looked at the code for that, but couldn’t figure it out. I want to use an array to load the jpegs, and then cycle through it constantly.

```auto

randomPics = random (pics.length);

```

I just don’t know how to fade them in and out. I grabbed this from a fla that faded pictures in and out using buttons

```auto

fadeIn = function () {
	if (this._alpha <= 100) this._alpha += 5 ;
	else this.onEnterFrame = null ;
	// When the movie is fully visible, it doesn't do anything
}

fadeOut = function () {
	if (this._alpha >= 0) this._alpha -= 5 ;
	else this.removeMovieClip () ;
	// When the movie is invisible, it is removed
}

```

I’m very bad at this programming stuff, so any help is much appreciated. I think I might keep my hands away from programming after this. Actually I have 1 more thing I wanna do, but then I will! :thumb:
