1 Reply Latest reply on Apr 2, 2012 1:47 PM by Claudiu Ursica

    How to pass skinclass to the custom component?

    jerry98225 Level 1

      Hi guys, I am trying to pass skinClass from my main application to my custom component. The following is my code but it gave me error saying 'Initializer for'skinType': values of tpye spark.componets.supportClasses.Skin' cannot be represented in text.  I am not sure if it's possible to do it. Any thought? Thanks a lot.



      <components:loginPanel id='loginPanel' horizontalCenter="33" verticalCenter="-15"




      loginPanel Component



      public var skinType:Skin;



      <s:Panel cornerRadius="5"


                   x="32" y="8"

                   width="373" height="200"

                   title="Login in"





        • 1. Re: How to pass skinclass to the custom component?
          Claudiu Ursica Level 4

          You are trying to pass a string to match the value of a class. In SkinnableComponent skinClass property is a style.

          You should use css styles or if you want to set it runtime do something like



          private var _skinRef:Class;


          public function set skinClassRef(value:Class):void


                          _skinClassRef = value;

                          if (loginPanelComp)



                              loginPanelComp.setStyle(skinClass, skinRef);