In Flash MX2004, Coding the over state of a movie clip button to modify the tint of another MC

I have a movie clip button (called "button"), with instances named btn_1, btn_2, btn_3, etc. Directly underneath each instance is a movie clip named text_1, text_2, text_3, etc. I want to code the over state of "button" so that on mouse ove, each instance changes the color of its corresponding external MC.
In other words when you mouse over btn_1, the color of text_1 changes from #FFFFFF to #CCFF00, etc., etc.


gabrielPennybackReliability Business Tools Analyst IIAsked:
Who is Participating?
TagGerrConnect With a Mentor Commented:
There are 2 good ways to do this, however one requires considerably more ActionScripting. The more difficult and time consuming (albeit somewhat better) way to code it is to use the ColorTransform class.

The quicker and easier way is to create different frames of the texts you want to change, giving them their different colors on the separate frames. Then you would place frame labels, such as "over" and "up", on the different colored frames. Inside your event handler, i.e. onMouseOver, onRollOver, etc, you would then gotoAndStop() the frame labels for the different colored texts. Example psuedo-code below:

btn_1.onRollOver = function(){
btn_1.onRollOut = function(){

One other important thing to watch for is the scope of the movie clips you will be editing. Be sure to make proper use of "_parent" and "this", if needed.
gabrielPennybackReliability Business Tools Analyst IIAuthor Commented:
Perfect. I was able to incorporate into the rest of my code for all the buttons quite easily. Thanks, TagGerr.  Please keep an eye out for my future questions, of which I think there will be many!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.