3 Replies Latest reply on Jan 25, 2011 11:44 AM by smon_ed

    changing alpha.disabled for spark button


      I have an application with spark buttons scattered throughout, created using various means and also with child classes.


      The client has said that they would like the disabled state changed because the alpha=0.5 state is not visible enough.


      It'll take me a very long time to scour through my whole applciation and set custom skins, etc and not sure how my styles will be affected and so on... so, I'd rather not have to create a load of new skin classes and custom components, just to change a single, simple value...


      ... so, in short... is there a way for me to change the alpha.disabled value of the standard Spark Button class easily in my application, so it will be applied to every instance and child of Button ?  Such as accessing and changing the value in the default button skin class: spark.skins.spark.ButtonSkin ???


      Thanks in advance

        • 1. Re: changing alpha.disabled for spark button
          UbuntuPenguin Level 4

          I generally stay far far far away from Flex and graphics, but have you looked at setting a CSS property that would affect every button.  Assuming the buttons are all of the same class ?  There is plenty of documentation on how to do it, unfortunately, I have never done it, just seen it done.

          • 2. Re: changing alpha.disabled for spark button
            smon_ed Level 1



            I have a fairly comprehensive set of css files, which get applied whenever the accessibility features are applied (high viz colours, large font sizes, font colour, background colours, etc) but I can't find any way of setting the alpha.disabled state of the standard button anywhere in the stylesheet.




            s|Button {
            color: "#000000";
            alpha: "1"

            s|Button:disabled {
            color: "#CCCCCC";
            alpha: "0.8";


            doesn't work and whatever I try fails.


            The only way I can think of at the moment would be to create a custom button class, set the value in the definition, and then chan ge all my Button instances to custom button instances... but that's potentially a really complicated thing for me to do at this stage of development.


            I need something much simpler.  If I could access the original ButtonSkin file and edit it, that would work, but I'm not sure whether those files are accessible in Flex Builder... or where they are.

            • 3. Re: changing alpha.disabled for spark button
              smon_ed Level 1

              Figured it:  Create a skin class (as a copy of the default Button skin class) and then assign the skin to the Button component in the css file


              s|Button {
              skinClass: ClassReference("com.fifthdimension.components.NewButtonSkin");


              Presumably I can do this with any other spark components that the client decides to change