Change Colors of Button through ActionScript

Posted on 2006-04-26
Last Modified: 2011-10-03
I would like to change the colors for each state including the hover color using ActionScript before the SWF is loaded. For instance I want to change all colors to Navy Blue then on mousing over change it to a Bright Blue. As a bonus if you know how to add a "glowing" effect when hovered please let me know in your answer to this question and I'll create another question with another 500 points. Thanks in advance!

Please download the sample map (see link below) and provide the ActionScript required and a brief instruction on how to update the fla file.

Resource Links:
Sample Map:
FAQ About Sample Map:
Question by:brian2k1
    LVL 19

    Expert Comment


    Dbl click on the movie clip to go into button mode
    Dbl click btn to edit color of the area
    Choose the blue that makes you happy.

    Part2: coming up...
    LVL 19

    Expert Comment

    Here's a tute on changing color (time constraints)

    LVL 19

    Accepted Solution

    My thought was, if you're going to change color before the swf loads... why not just change it in the fla? No sense in adding code just for the sense of adding code. Next you can handle the rollovers, and that's okay. The tutorial covers that. I should also mention that Color() was deprecated in this last version. The new colorTransform is confusing, though, at least for now, since I have not had any projects that deal with it.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    Title # Comments Views Activity
    Best way to Display MP4 Video 5 305
    Flash being Disabled - help! 20 325
    Flash movie or gif/animation? 3 809
    Advertising design for my own Purpose 5 61
    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
    The goal of the tutorial is to teach the user how to how to record live broadcast.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now