# Fading help with current script

**URL:** <https://forum.kirupa.com/t/fading-help-with-current-script/154802>\
**Category:** Uncategorized\
**Created:** [July 12, 2005, 9:09pm UTC](https://forum.kirupa.com/t/fading-help-with-current-script/154802 "2005-07-12T21:09:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![putch](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@putch](https://forum.kirupa.com/u/putch)\
**Post date:** [July 12, 2005, 9:09pm UTC](https://forum.kirupa.com/t/fading-help-with-current-script/154802/1 "2005-07-12T21:09:22Z")

</div>

Hey guys,

I have a script that fades a picture from white to color. But how do I have it fade from nothing (zero alpha) to white, and then to color, also, have it fade back to white and then to nothing

I attached the fla as an example. Here is the original code:

var cColor;  
//prototype by kode  
MovieClip.prototype.fadeColor = function(cto, ease) {  
var myColor = new Color(this);  
myColor.setTransform({ra:100, rb:255, ga:100, gb:255, ba:100, bb:255, aa:100, ab:0});  
this.onEnterFrame = function() {  
for (var c in cColor) {  
cColor[c] += (cto[c]-cColor[c])/ease;  
}  
myColor.setTransform(cColor);  
};  
};  
pic.fadeColor({ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0}, 20);  
var myColor = new Color(pic);  
cColor = myColor.getTransform();
