# \[FMX\] some code using \_alpha

**URL:** <https://forum.kirupa.com/t/fmx-some-code-using--alpha/7398>\
**Category:** flash\
**Created:** [October 30, 2002, 3:16am UTC](https://forum.kirupa.com/t/fmx-some-code-using--alpha/7398 "2002-10-30T03:16:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nipp2002](https://avatars.discourse-cdn.com/v4/letter/n/e5b9ba/32.png) [@nipp2002](https://forum.kirupa.com/u/nipp2002)\
**Post date:** [October 30, 2002, 3:16am UTC](https://forum.kirupa.com/t/fmx-some-code-using--alpha/7398/1 "2002-10-30T03:16:53Z")

</div>

ok so this code…

```auto

onClipEvent( enterFrame) {
	if (this._alpha > 0 ) {
		this._alpha -= 5; 
	} else if (this._alpha < 100 ) {
		this._alpha += 100;
	}
}

```

How would I make this code increase the alpha back to 100 instead of just “changing” it to 100 in one frame ?

I’m confused. :-\

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 30, 2002, 3:24am UTC](https://forum.kirupa.com/t/fmx-some-code-using--alpha/7398/2 "2002-10-30T03:24:06Z")

</div>

What are you trying to do exactly? Have it fade back and forth in and out?

To do the code snippets you need to put [CODE] in front of the code and [/CODE] at the end of the code.

Remove the spaces, I didn’t want the board to convert that text…haha.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 30, 2002, 3:30am UTC](https://forum.kirupa.com/t/fmx-some-code-using--alpha/7398/3 "2002-10-30T03:30:53Z")

</div>

yep i want it to fade in and out. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 30, 2002, 3:34am UTC](https://forum.kirupa.com/t/fmx-some-code-using--alpha/7398/4 "2002-10-30T03:34:18Z")

</div>

YAY!!! )@#(_$)(@#_)$\*(@#$(# I"M HAPPY!!! :nerd:

I got it all bymyself !!

```auto

onClipEvent(load) {
	alpha = 5;
}
onClipEvent(enterFrame) {
	this._alpha -= alpha;
	if (this._alpha >= 100 ) {
		alpha = -alpha;
	} else if ( this._alpha <=0 ) {
		alpha = -alpha;
	}
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 30, 2002, 3:39am UTC](https://forum.kirupa.com/t/fmx-some-code-using--alpha/7398/5 "2002-10-30T03:39:47Z")

</div>

Very good 🙂
