# Change Alpha while applying color thru ActionScript

**URL:** <https://forum.kirupa.com/t/change-alpha-while-applying-color-thru-actionscript/26237>\
**Category:** Uncategorized\
**Created:** [July 21, 2003, 8:37am UTC](https://forum.kirupa.com/t/change-alpha-while-applying-color-thru-actionscript/26237 "2003-07-21T08:37:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neh\_g](https://avatars.discourse-cdn.com/v4/letter/n/b77776/32.png) [@neh\_g](https://forum.kirupa.com/u/neh_g)\
**Post date:** [July 21, 2003, 8:37am UTC](https://forum.kirupa.com/t/change-alpha-while-applying-color-thru-actionscript/26237/1 "2003-07-21T08:37:20Z")

</div>

hello,  
I am making a game where i want my movieclip with diff color. i am applying color thru…

```
tintColor = new Color(myMovieClip);
tintColor.setRGB(random(255255255));

```

this will apply a full color to my movieclip. wht i want to apply a color with opacity(alpha) e.g if random color came to Red then red should apply at myMovieClip with 50% opacity. How can i achive tht? can anybody help me.  
thanks  
Neh

---

<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:** [July 21, 2003, 8:39am UTC](https://forum.kirupa.com/t/change-alpha-while-applying-color-thru-actionscript/26237/2 "2003-07-21T08:39:18Z")

</div>

myMovieClip.\_alpha = 50;

e.s.x.s

---

<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:** [July 21, 2003, 8:46am UTC](https://forum.kirupa.com/t/change-alpha-while-applying-color-thru-actionscript/26237/3 "2003-07-21T08:46:50Z")

</div>

thanks…but i dont movieCLip alpha to change… i want color to apply on movieclip with 50% opacity…

---

<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:** [July 21, 2003, 9:20am UTC](https://forum.kirupa.com/t/change-alpha-while-applying-color-thru-actionscript/26237/4 "2003-07-21T09:20:36Z")

</div>

ok try to use transform color object properties:  
[AS]  
myNewColor = new Color(myMovieClip);  
myColorTransform = new Object();  
myColorTransform.ra = 50;  
myColorTransform.rb = 244;  
myColorTransform.ga = 40;  
myColorTransform.gb = 112;  
myColorTransform.ba = 12;  
myColorTransform.bb = 90;  
//------u can set alpha of color----------  
myColorTransform.aa = 40;  
myColorTransform.ab = 70;  
//----------------------------------------------  
myColorTransform.setTransform(myColorTransform);

/\*  
ra is the percentage for the red component (-100 to 100).

rb is the offset for the red component (-255 to 255).

ga is the percentage for the green component (-100 to 100).

gb is the offset for the green component (-255 to 255).

ba is the percentage for the blue component (-100 to 100).

bb is the offset for the blue component (-255 to 255).

aa is the percentage for alpha (-100 to 100).

ab is the offset for alpha (-255 to 255). \*/  
[/AS]

e.s.x.s

---

<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:** [July 21, 2003, 6:27pm UTC](https://forum.kirupa.com/t/change-alpha-while-applying-color-thru-actionscript/26237/5 "2003-07-21T18:27:42Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?threadid=25935&highlight=alpha+actionscript](http://www.kirupaforum.com/forums/showthread.php?threadid=25935&highlight=alpha+actionscript)

check out LIB’s prototype
