1 Reply Latest reply on Dec 18, 2011 12:43 AM by drkstr_1

    Extend MXML Skin Class

    MatteoLegittimo Level 1


      i have this skin class for my button:


      <?xml version="1.0" encoding="utf-8"?>

      <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"



                  alpha.disabled="0.5" width="175" height="30">







              private var backgroundColorOver:int= 0xFFFFFF;


              private var textColorOver:int= 0xAAA9A9;




              <s:SolidColor id="fillColor"/>

              <s:SolidColorStroke id="strokeColor" color="0xAAA9A9"/>



              <s:State name="up"/>

              <s:State name="over" stateGroups="overButton"/>

              <s:State name="down" stateGroups="overButton"/>

              <s:State name="disabled"/>


          <s:Rect width="100%" height="100%">


                  <s:SolidColorStroke color="0xAAA9A9" weight="1" joints="miter"/>



                  <s:SolidColor color="0xAAA9A9" color.overButton="{backgroundColorOver}"/>



          <s:Label id="labelDisplay" color="0xFFFFFF" color.overButton="{textColorOver}"

                   width="100%" height="100%" textAlign="center" verticalAlign="middle" fontSize="14" fontFamily="Helvetica"/>



      Instead to  duplicate for onther button which have the background and the enabled state different, i whould like to know hou can override this class.

      Thanks a lot.

        • 1. Re: Extend MXML Skin Class
          drkstr_1 Level 4

          MXML can be extended, but not in a way that would be help in this regards. Most of the useful MXML is assigned to mxmlContent, and this would all be overridden in the extension with an all-or-nothing type of deal.


          What you can do is implement custom styles to give you the desired customization, or just rewrite the MXML (all said and done, the later is probably the quickest).