# Mouse fades

**URL:** <https://forum.kirupa.com/t/mouse-fades/12793>\
**Category:** Uncategorized\
**Created:** [February 4, 2003, 9:06pm UTC](https://forum.kirupa.com/t/mouse-fades/12793 "2003-02-04T21:06:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maizoon](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@Maizoon](https://forum.kirupa.com/u/Maizoon)\
**Post date:** [February 4, 2003, 9:06pm UTC](https://forum.kirupa.com/t/mouse-fades/12793/1 "2003-02-04T21:06:39Z")

</div>

Like the [www.macromedia.com](http://www.macromedia.com) site’s menu bar, when you rollover the menu bars it slowly fades to the color, and when you rollout it fades back. How is that done? Best I have been able to do is instant color fades? :evil: :evil: :evil:

---

<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:** [February 4, 2003, 9:35pm UTC](https://forum.kirupa.com/t/mouse-fades/12793/2 "2003-02-04T21:35:15Z")

</div>

in my opinion … that’s just another shape fading in

but if you want to change the color … :bad:

```auto
onClipEvent (load) {
	myColor = new Color (this)
	myColorTrans = myColorVars = myColor.getTransform ()
}

onClipEvent (enterFrame) {
	for (k in myColorVars) {
		myColorVars[k] += (myColorTrans[k] - myColorVars[k]) / 4
	}
	myColor.setTransform (myColorVars)
}

on (rollOver) {
	myColorTrans = { ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:0, ab:0 }
}

on (rollOut) {
	myColorTrans = { ra:0, rb:0, ga:0, gb:0, ba:0, bb:0, aa:0, ab:0 }
}

```

all you have to do is change the values of [color=red]myColorTrans[/color] in the rollOver and rollOut handlers

**ra** is the percentage for the red [size=1][-100 to 100][/size]  
**rb** is the offset for the red [size=1][-255 to 255][/size]  
**ga** is the percentage for the green [size=1][00 to 100][/size]  
**gb** is the offset for the green [size=1][-255 to 255][/size]  
**ba** is the percentage for the blue [size=1][-100 to 100][/size]  
**bb** is the offset for the blue [size=1][-255 to 255][/size]  
**aa** is the percentage for alpha [size=1][-100 to 100][/size]  
**ab** is the offset for alpha [size=1][-255 to 255][/size]

---

<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:** [February 4, 2003, 9:40pm UTC](https://forum.kirupa.com/t/mouse-fades/12793/3 "2003-02-04T21:40:08Z")

</div>

For what it is worth, the intro to flash tutorial has 3 buttons that are black/white and they have a matching shape behind them that fade in when you move the mouse over them.

---

<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:** [February 4, 2003, 9:42pm UTC](https://forum.kirupa.com/t/mouse-fades/12793/4 "2003-02-04T21:42:43Z")

</div>

> in my opinion … that’s just another shape fading in

what did i say? 😛

---

<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:** [February 4, 2003, 10:11pm UTC](https://forum.kirupa.com/t/mouse-fades/12793/5 "2003-02-04T22:11:54Z")

</div>

Hehehe, Your quoting yourself and asking what you said at the same time?? I think you need a break more than I do 🙂

---

<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:** [February 4, 2003, 10:15pm UTC](https://forum.kirupa.com/t/mouse-fades/12793/6 "2003-02-04T22:15:55Z")

</div>

nope …

> what did i say? 😛

was for you !!

but yes … i do need a break 😉
