Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

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

Posted on 2007-12-04
2
Medium Priority
?
221 Views
Last Modified: 2010-04-03
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.

Thanks!

John
0
Comment
Question by:gabrielPennyback
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
TagGerr earned 2000 total points
ID: 20407928
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(){
        text_1.gotoAndStop("over");
}
btn_1.onRollOut = function(){
        text_1.gotoAndStop("up");
}

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.
0
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 20418295
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!

John
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
It’s easy to embed any of your public Prezi presentations on your website or social network to share with others. Learn how simple it is in this tutorial.
Suggested Courses

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question