View Full Version : Movieclip Tint
Voetsjoeba
August 10th, 2003, 12:32 PM
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 ?
kode
August 10th, 2003, 02:26 PM
var myColor = new Color(myMovieClip);
myColor.setTransform({rb:255, aa:30});
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary146.html
That should do...
Voetsjoeba
August 10th, 2003, 02:31 PM
Yup, that does it. Thanks kax :) How do you clear the setTransform ? When I click another button, it adds the tranparancy instead of changing it.
kode
August 10th, 2003, 03:10 PM
myColor.setTransform({rb:0, aa:100});
:P
Voetsjoeba
August 11th, 2003, 03:24 AM
That didn't work. This worked though:
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});
Thanks for the help =)
kode
August 11th, 2003, 03:31 AM
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. :P
Voetsjoeba
August 16th, 2003, 02:11 AM
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 :) You couldn't now I had three buttons, it worked for one :)
Thanks Kax :)
kode
August 16th, 2003, 03:23 AM
It makes sense now... :P
You're welcome. ;)
Kadarkarai
January 7th, 2008, 07:12 AM
That didn't work. This worked though:
ActionScript Code:
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});
Thanks for the help =)
Thanks for the help its working:esmirk:
Voetsjoeba
January 7th, 2008, 01:38 PM
Wow, blast from the past.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.