Categories
Featured jobs
» More ActionScript, Flash and Flex jobs.
» Advertise a job for free
Our network
Advertisement

 »  Home  »  Tutorials  »  Flash  »  Intermediate  »  Tint Animation, BindColor and RGBColor classes

Tint Animation, BindColor and RGBColor classes

By Amen KAMALELDINE | Published 03/19/2008 | Intermediate | Rating:
Amen KAMALELDINE

Amen is an industrial informatics engineer. he studied the first four years of his education in Faculty of Engineering in Lebanon. He went to France to Continue his studies by doing the fifth year of engineering and the master TIS (Technologie Information et Système) in the same time at UTC (Université de Technologie de Compiègne). He also work as a freelancer in flash development field. He is always interessted in the new multimedia technologies.

 

View all articles by Amen KAMALELDINE
Introduction

In this tutorial we will learn how to dynamically animate the color of a movieclip as it called Applying a tint to the movie clip, although with flash 8 we can use the ColorTransform Class which can make what we intend to do but those classes are developed from a while so I created this tutorial based on this files.

We will create 2 class:

1. BindColor Class which will provide 3 useful functions

a. BindColorTo Static function that bind a color to a movie clip instance

b. colorToRGB Static function that retrieve an RGBColor Object from a color number

c. getRGBFrom Static function that retrieve an RGBColor Object from a movieclip

2. RGBColor a Class which can be attached to a movieclip instance

a. attachTo attach the RGBObject to a movieclip.

b. bindTo this function bind the color of the RGBObject to a movieclip instance.

c. red proprety that indicate the red value of the RGBColor object

d. blue proprety that indicate the blue value of the RGBColor object

e. green proprety that indicate the green value of the RGBColor object

f. color proprety that indicate the color value of the RGBColor object

so for if we need to change a color of a movie clip we create an RGBColor object and bind it to the target movie clip.
But if we want to animate the color from on to another we create an empty RGBColor object, attach it to the movie clip instance and then we tween the red, green, blue properties of the RGBColor and we will achieve what we want.

Result



Let’s start with the RGBColor class on the next page



Spread The Word / Bookmark this content

Clesto Digg it! Reddit Furl del.icio.us Spurl Yahoo!

Comments



Search Entire Site
Add to Google
Advertisements
Article Options
Latest New Articles
Set up a simple IIS Server for Flash
by Peter McBride

Day 1 at FITC Toronto 2008
by Anthony Pace

Simple reflection effect with AS2
by Jean André Mas

ActionScript.org Meets Josh Tynjala (aka dr_zeus)
by ActionScript.org Staff

Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware
by Sabrina F

mailing list
Enter your email address:
mailing list
Subscribe Unsubscribe
© 2000-2007 actionscript.org! All Rights Reserved.
Read our Privacy Statement and Terms of Use...
Our dedicated server is hosted and managed by WebScorpion Webhosting.