1 Reply Latest reply on Dec 17, 2009 4:14 PM by mike_morales

    Possible to dynamically apply a skin to a skinnable container?

    mike_morales Level 2

      Hello all,

       

      I ran into a problem with one of the apps that I am building.  Basically, I need to dynamically set a background color (skin) based on a value that I am pulling from my database.  There are 4 possible values (1-4) that this database field can be, and I want to set background color to each possible value. I thought I could just use a skinnable container and use the 'skinClass="X"' property of the skinnable container and apply one of my 4 custom skins, but when I try to do this with actionscript, it says that there is no property called 'skinClass' on the skinnableContainer? huh?? I am not understanding why, when using the mxml tag <s:skinnableContainer>, and type 'skinClass' the property exists, but, when I try to reference it though AS, it says it doesn't exist? I gave my skinnable container an id and tried referencing the skinClass, but again, it's not there. What am I doing wrong?  Better yet, if someone can give me a little insight into why the property can't be referenced though AS calling the id->skinclass? This will be very helpful in my future projects. Thanks in advance!

       

      Mike