hello…!
on the var white_trans( which changes a pic from normal to white)…i need to change the code from white to normal… any ideas?
::i got this from scotty’s thread::
//prototype by kode
MovieClip.prototype.fadeColor = function(cto, ease) {
var myColor = new Color(this), cColor = myColor.getTransform();
this.onEnterFrame = function() {
for (var c in cColor) {
cColor[c] += (cto[c]-cColor[c])/ease;
}
myColor.setTransform(cColor);
};
};
//One way to do it is define the target colors and use them in different functions
var NEG_TRANS = {ra:-100, rb:255, ga:-100, gb:255, ba:-100, bb:255, aa:100, ab:0};
var NEUTRAL_TRANS = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
var BLACK_TRANS = {ra:100, rb:-255, ga:100, gb:-255, ba:100, bb:-255, aa:100, ab:0};
[COLOR=red]var WHITE_TRANS = {ra:100, rb:255, ga:100, gb:255, ba:100, bb:255, aa:100, ab:0};[/COLOR]
function invert() {
container.fadeColor(NEG_TRANS, 20);
}
function reset() {
container.fadeColor(NEUTRAL_TRANS, 20);
}
function fadeToBlack() {
container.fadeColor(BLACK_TRANS, 20);
}
function fadeToWhite() {
container.fadeColor(WHITE_TRANS, 20);
}
button1.onRelease = reset;
btn2.onRelease = invert;
btn3.onRelease = fadeToBlack;
button8.onRelease = fadeToWhite;
//another way to do it is to define the target color in the onrelease
button7.onRelease = function() {
pic.fadeColor({ra:100, rb:80, ga:100, gb:155, ba:100, bb:60, aa:100, ab:0}, 20);
};
btn6.onRelease = function() {
pic.fadeColor({ra:100, rb:180, ga:100, gb:45, ba:100, bb:90, aa:100, ab:0}, 20);
};