# alphaOffset, alphaMultiplier, and \_alpha

**URL:** <https://forum.kirupa.com/t/alphaoffset-alphamultiplier-and--alpha/184192>\
**Category:** flash\
**Created:** [April 3, 2006, 5:26am UTC](https://forum.kirupa.com/t/alphaoffset-alphamultiplier-and--alpha/184192 "2006-04-03T05:26:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenvunz](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kenvunz](https://forum.kirupa.com/u/kenvunz)\
**Post date:** [April 3, 2006, 5:26am UTC](https://forum.kirupa.com/t/alphaoffset-alphamultiplier-and--alpha/184192/1 "2006-04-03T05:26:28Z")

</div>

Can someone explain to me the relations between these properties?

I’m trying to do tween color transformation by ActionScript using [devonair](http://www.kirupa.com/forum/member.php?u=29340)’script, but how to set the alphaOffset value so my animation tweening from 0 - 30 (\_alpha value).

devonair script can be found here:

> **[Color tween controled by Actionscript.](https://www.kirupa.com/forum/showthread.php?t=210435&highlight=tween+class)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

thanks

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 3, 2006, 6:04am UTC](https://forum.kirupa.com/t/alphaoffset-alphamultiplier-and--alpha/184192/2 "2006-04-03T06:04:58Z")

</div>

_alphaOffset_ and _alphaMultiplier_ are properties of the ColorTransform class whereas _\_alpha_ is a property of the movie clip class.

With the ColorTransform class, the ARGB offset and multiplier properties will modify each of the colour channels using the following equation:

**newChannelValue = (oldChannelValue \* channelMultiplier) + channelOffset**

The _\_alpha_ property and the alphaMultiplier properties perform the exact same function in that they take the original value and take a percentage out of it to give you a new value. In fact, setting the _\_alpha_ property of a movie clip will directly change the \*transform.colorTransform.alphaMultiplier \*value of that movie clip. For instance given two movie clips, test1 and test2, the following will perform the exact same function on each:

```auto
//modifying test1:
import flash.geom.*;
var ct:ColorTransform = new ColorTransform();
ct.alphaMultiplier = .2;
ct.alphaOffset = 0;
test1.transform.colorTransform = ct;
//--
//modifying test2:
test2._alpha = 20;
//--

```

Now for your question, tweening the alpha value of a movie clip from 0 to 30. I would stick with the \_alpha property as it avoids some extra/unnescary code for something so simple:

```auto
import mx.transitions.Tween;
import mx.transitions.easing.*;
var at:Tween = new Tween(mc, "_alpha", Regular.easeOut, 0, 30, 1, true);

```

But if you are bent on using the ColorTransform class, this will also work:

```auto
import mx.transitions.Tween;
import mx.transitions.easing.*;
import flash.geom.*;
var ct:ColorTransform = new ColorTransform();
var at:Tween = new Tween(ct, "alphaMultiplier", Regular.easeOut, 0, 0.3, 1, true);
at.onMotionChanged = function():Void {
 mc.transform.colorTransform = ct;
};

```

Hope this helps :hoser:

---

<div class="post-metadata">

**Author:** ![kenvunz](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kenvunz](https://forum.kirupa.com/u/kenvunz)\
**Post date:** [April 3, 2006, 6:39am UTC](https://forum.kirupa.com/t/alphaoffset-alphamultiplier-and--alpha/184192/3 "2006-04-03T06:39:02Z")

</div>

thanks for your quick reply, I now clearly understand alphaMultiplier and \_alpha. But i’m still a bit unsure about the alphaOffset one, what is its main purpose?  
thanks

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 3, 2006, 6:52am UTC](https://forum.kirupa.com/t/alphaoffset-alphamultiplier-and--alpha/184192/4 "2006-04-03T06:52:51Z")

</div>

In that equation, it is the number that is added to the alpha channel after it has been multiplied by the alphaMultiplier.

For example, if we had the following values  
currentAlpha = 100  
alphaMultiplier = 0.08  
alphaOffset = 120

And we plug those valuew sinto the equation we would get:  
newAlpha = (currentAlpha \* alphaMultiplier) + alphaOffset  
newAlpha = (100 \* 0.08) + 120  
newAlpha = (8) + 120  
newAlpha = 128

:cap:

---

<div class="post-metadata">

**Author:** ![kenvunz](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kenvunz](https://forum.kirupa.com/u/kenvunz)\
**Post date:** [April 3, 2006, 7:17am UTC](https://forum.kirupa.com/t/alphaoffset-alphamultiplier-and--alpha/184192/5 "2006-04-03T07:17:26Z")

</div>

So the newAlpha value in the equation will be ranging between -255 \>\> 255. right? not between 0 \>\> 100.:geek:  
thanks for your quick help.

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 3, 2006, 8:12am UTC](https://forum.kirupa.com/t/alphaoffset-alphamultiplier-and--alpha/184192/6 "2006-04-03T08:12:00Z")

</div>

That is correct. Glad to help :hoser:
