Action Script: Color Object
- Started
- Last post
- 7 Responses
- CyBrainX
I'm trying to do a color transform on a movie clip, within a movie clip.
This is how to do it normally:
myColor = new Color(myMovieClip);
- JazX0
cool!
- Seph0
I hope thats a sarcastic wow.
- seventhHope0
if y ou are trying to tween the object why dont you just make whatever in the movie clip upi wamt tp change colors a graphic and use the tint property int the property panel. hope i helped
- CyBrainX0
thanks Boz, I'll try that out later. I was trying to make color swatches that are created when you click on the wall sections. Each swatch would change color to match the current wall.
- CyBrainX0
I just got it fixed. There are other steps I need to make this work the way I want to, but click on the wall section against my table and change the colors. The 1st swatch will change too.
- F_EddyShears0
allright, try this for an AS color change:
//on actions frame (_root):
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...
}
}//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);
}