Movieclip Tint

Hi,

I have an image inside a movieclip, with the alpha set to 30%. Now I’d want to be able to change the tint (like Hue from Photoshop) of that movieclip on button press. I figured it might be possible by creating a new movieclip, putting a transparant square in it and changing the _alpha and color on buttonpress, but isn’t it possible to do directly change the tint of the movie with the image inside with actionscript ?

I tried senocular’s method (http://proto.layer51.com/d.aspx?f=615), but my movie turned all pink instead of red tranparant. Can anyone help me with this ?

[AS]var myColor = new Color(myMovieClip);
myColor.setTransform({rb:255, aa:30});[/AS]
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary146.html

That should do…

Yup, that does it. Thanks kax :slight_smile: How do you clear the setTransform ? When I click another button, it adds the tranparancy instead of changing it.

[AS]myColor.setTransform({rb:0, aa:100});[/AS]
:stuck_out_tongue:

That didn’t work. This worked though:

[AS]
var clearColor = new Color(_root.bg);
clearColor.setTransform({rb:0,gb:0,bb:0, aa:100});
var redColor = new Color(_root.bg);
redColor.setTransform({rb:100, aa:30});
[/AS]

Thanks for the help =)

No problem, I guess…

That makes absolutely no sense, though. The default value for gb and bb, is zero!! You shouldn’t have to set them to zero again. :stuck_out_tongue:

Oh, I see, I forgot to mention that I have three buttons :blush: A red, a blue and a green one. So I had to set everything back to zero before changing it :slight_smile: You couldn’t now I had three buttons, it worked for one :slight_smile:

Thanks Kax :slight_smile:

It makes sense now… :stuck_out_tongue:

You’re welcome. :wink: