2 Replies Latest reply on Dec 7, 2010 2:53 PM by Sible99

    How to apply mxml skin programmatically


      I have defined two mxml skins for a button and I'd like to change skin during runtime, but I don't know how. This code doesn't work:

      var skin:Class = PlayButtonSkin; //it's a PlayButtonSkin.mxml file

      button.setStyle("upSkin", skin);

      Nothing happens. No error, no skin change. The PlayButtonSkin.mxml file is defined as follows (plus headers):

              <s:State name="up" />
              <s:State name="over" />
              <s:State name="down" />
              <s:State name="disabled" />

      where soundStop is a valid fxg file

      Please help.