Colour Changing // Flash
- Started
- Last post
- 5 Responses
- Robo
Is it possible to change the colour of a movie using actionscript.
I have 8 buttons - when i click on on of these buttons I would like the movie to smoothly change to a specific colour.
Can someone help, or point me in the way of a tutorial?
Thanks!
- sexypixel0
i saw exactly that on flashkit a while ago
http://www.flashkit.com
- Robo0
in movies or tutorials?
- Robo0
All I can find is the actionscript to change colours instantly, i would like a colour to gradually (smoothly) change like a tween.
Can anyone help?
(Please)
- jarmstrong0
tab 1: 010
- ********0
Place the following on actions frame in main timeline:
Color.prototype.setColorRGB = function (r, g, b) {
if (!isNaN(r+g+b) && r=0 && g=0 && b=0) {
r = (parseInt (r)).toString(16); r.length == 1 ? r = "0" + r : r;
g = (parseInt (g)).toString(16); g.length == 1 ? g = "0" + g : g;
b = (parseInt (b)).toString(16); b.length == 1 ? b = "0" + b : b;this.setRGB(parseInt("0x"+r+g+b...
}
}To examples of usage:
onClipEvent(load) {
c = new Color(mc);
c.setColorRGB(255,0,255);
}or
on (release) {
c = new Color(_root.mc_2);
c.setColorRGB(0,0,0);
}hope that helps.