2 Replies Latest reply on Feb 21, 2007 1:45 PM by Newsgroup_User

    How do modify the highlight color of a button to RED?

    Level 7
      HI! I want to know what is the easiest way to modify the highlight color or
      a button to RED. ( I want the helo-green or orange theme).

      I know how to change the theme or by using the setStyle("themeColor",
      "haloOrange"); BUT there is no RED. so what is the easiest root to modify
      all button instances.?

      PaulD


        • 1. Re: How do modify the highlight color of a button to RED?
          Level 7
          Paul,

          > I know how to change the theme or by using the setStyle("themeColor",
          > "haloOrange"); BUT there is no RED. so what is the easiest root to
          > modify all button instances.?

          Instead of named themes (like haloOrange), just specify a hexadecimal
          color as the second parameter. setStyle("themeColor", 0xFF0000); -- You'll
          have to experiment whether that second parameter needs to be in quotes or
          not.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: How do modify the highlight color of a button to RED?
            Level 7
            David Stiller wrote:
            > Paul,
            >
            >> I know how to change the theme or by using the setStyle("themeColor",
            >> "haloOrange"); BUT there is no RED. so what is the easiest root to
            >> modify all button instances.?
            >
            > Instead of named themes (like haloOrange), just specify a hexadecimal
            > color as the second parameter. setStyle("themeColor", 0xFF0000); --
            > You'll have to experiment whether that second parameter needs to be in
            > quotes or not.
            >
            >
            > David Stiller
            > Adobe Community Expert
            > Dev blog, http://www.quip.net/blog/
            > "Luck is the residue of good design."

            HI! Thanks it worked. below is the whole script to modify an instance to
            RED -- or any color.

            import mx.styles.CSSStyleDeclaration;
            var new_style:Object = new CSSStyleDeclaration();
            _global.styles.myStyle = new_style;
            new_style.setStyle("color", 0x666699);
            setStyle("styleName", "myStyle");

            // my_button.setStyle("styleName", "myStyle"); --- Use this to only modify
            this instance.
            _global.styles.myStyle.setStyle("themeColor", 0xC83F3F);

            Hope this helps someone else. :)

            Paul D