5 Replies Latest reply on Apr 5, 2012 6:33 AM by p0l0us

    CSS getStyleDeclaration does not work for class selector

    PietroSK

      Hi everyone!

       

      We have been migrating to flex 4.6 and we are facing some issues with CSS styles.

      Let's say you have CSS file:

       

      Label.myStyle

      {

          ...
      }

       

       

      If I use this style in mxml, it works well:

      <mx:Label styleName="myStyle" />

       

      But if I want to get that style declaration:

      StyleManager.getStyleManager(null).getStyleDeclaration(".myStyle");

      OR

      StyleManager.getStyleManager(null).getStyleDeclaration("Label.myStyle");

      OR

      StyleManager.getStyleManager(null).getMergedStyleDeclaration(".myStyle");

      OR

      StyleManager.getStyleManager(null).getMergedStyleDeclaration("Label.myStyle");

      it always returns null

       

      Does anybody face this problem as well? Can somebody give me a hint?

       

      Thank you very much!

      Peter