IMO, the difficulty of adding a new property/style to the skin is a flaw in the Spark skinning model. You will have to subclass button so you can use a that as the hostcomponent of your custom skin.
I believe a workaround is to use getStyle() in the skin to get a custom CSS property, and define custom selectors for each of the buttons. You will not be able to use the custom CSS property in MXML attributes without subclassing Button, though, so you have to use ID or Class selectors or something like that. -Alex On 10/2/13 6:36 AM, "Scott Matheson" <[email protected]> wrote: >Hi > Good idea, I have used my own FXG graphics for the button, I have based >my button on standard button > >How do I > >>Make sure to set userChromeColor to true in the skin initialization >>script. > > >I still would still like to learn how do extend > >Scott > > > >On 10/2/13 2:17 PM, "Maurice Amsellem" <[email protected]> >wrote: > >>Actually, you could just set "chromeColor" for the button. >>That would colorize everything but the label. >> >>If you have customized the skin, (and derived from SparkSkin) you can >>still use chromeColor, but you will have to control yourself the part >>that would be colored or not. >>Make sure to set userChromeColor to true in the skin initialization >>script. >> >>Regards, >> >>Maurice >> >>-----Message d'origine----- >>De : Scott Matheson [mailto:[email protected]] >>Envoyé : mercredi 2 octobre 2013 14:58 >>À : [email protected] >>Objet : Extending Spark Button Skink >> >>Hi >> I have a simple problem, I have skinned a button, I need X copies of the >>button the only difference is color, I would like to be able to use >> >> myButton color = {HostComponent.mycolour} >> >>As a mycolour is not a property of of "spark.components.Button" I >>believe I have to extend "spark.components.Button" first >> >>This is getting a bit more complex than my skill set support :( >> >> An anyone provide an example of how I extend a spark skin, I have spend >>days looking on the internet for examples with out any luck >> >>Scotty >> >> >>________________________________ >> >>Disclaimer: This electronic mail and any attachments are confidential and >>may be privileged. If you are not the intended recipient, please notify >>the sender immediately by replying to this email, and destroy all copies >>of this email and any attachments. Thank you. > > >________________________________ > >Disclaimer: This electronic mail and any attachments are confidential and >may be privileged. If you are not the intended recipient, please notify >the sender immediately by replying to this email, and destroy all copies >of this email and any attachments. Thank you.
