4 Replies Latest reply on Apr 19, 2010 10:19 AM by Flex harUI

    Am I using style manager incorrectly?

    tehxike1

      I have default css code in one of my components.  As soon as I new one of these components, every AreaSeries in my charts disappears.  The name of my styles don't matter- I can change them to "mal,kaylee,jayne,river" and the AreaSeries still disappear.  If a new chart with an AreaSeries is created, it looks fine.  I've tried stepping through the commitProperties/updateDisplayList of AreaSeries, but it's pretty complicated.  I tried creating a basic example to demonstrate the problem, and naturally it wasn't reproducible in it.

       

      Here's my entire default style code, a bit wordy:

       

      private static var _styleDefaults:Object =
          {
              baseColor: 0xCBCFD3,
              outputColor: 0xcbe5b6,
              alertBlendColor: 0xFFFFFF,
              outputBlendColor: 0x999999
          }

       

      private var stylesInit:Boolean = classConstruct();

       

      private static function classConstruct():Boolean
      {
          var styleManager:IStyleManager2 = StyleManager.getStyleManager(null);
          var styleDeclaration:CSSStyleDeclaration = styleManager.getStyleDeclaration("com.woo.map.view.PanelRenderer");
          var changed:Boolean = false;
         
          // If there's no style declaration already, create one.
          if (!styleDeclaration)
          {
              styleDeclaration = new CSSStyleDeclaration();
              changed = true;
          }
         
          for (var styleProp:String in _styleDefaults)
          {
              if (!styleManager.isValidStyleValue(styleDeclaration.getStyle(styleProp)))
              {
                  styleDeclaration.setStyle(styleProp,_styleDefaults[styleProp]);
                  changed = true;
              }
          }
         
          if (changed)
          {
              styleManager.setStyleDeclaration("com.woo.map.view.PanelRenderer", styleDeclaration,true);
          }
         
          return true;
      }