Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Tints?

Status
Not open for further replies.

Flashgordon

Technical User
Apr 5, 2001
52
GB
Is there anyway to dynamically change the tint of a symbol?
I thought I could get site visitors to be able to pick their own colour scheme for my site and I thought I could change the tint values of symbols with actionscript. But it seems tints are variables you can't change.
Andy
 
Yes you can change the "tints" of any movie clip with new Color, setRGB or setTransform

Check it out in the Actionscript dictionary.
There's a copy & paste example in the setTransform definition (under C for color!).

You can also check this tutorial that uses that method to change the background colors of your movie, thus creating a kind of "changing color sheme" effect.


Regards,
new.gif
 
You can change tint via the Color() class which allows you to create colour objects for your clips.

This allows you to set RGB values for each clip and alter them programmatically on the fly.

Say you took a clip called myClip...

myColour=new Color(myClip);//set up new color object
myColour.setRGB(0xCC6699);//assign the clip a new colour


You can obviously be more subtle than this example by using Red, Green and Blue offsets via the setTransform() method which gives you fine control over the tint and alpha of an object (exactly like "advanced" in the effects panel).

myColour=new Color(myClip);//set up new color object
myTransform=new Object();
myTransform.rb+=180;//boost the red level(try this on a greenish clip)
myColour.setTransform(myTransform);//set the transform


It's a huge topic and this only scratches it but I hope it helps.
 
"..Let's Get Readyyyyyy Toooooo Ruuuuuuuumbllllle.."

;-)
dave@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top