2 Replies Latest reply on Oct 23, 2008 1:58 PM by ericbelair

    CSS - How to best handle color settings?

    ericbelair Level 1
      I'm starting to get frustrated with CSS in Flex... It seems like external stylesheets are a waste of time, since you can't set a lot of styles with them. Instead I am forced to set the styles in ActionScript, like this:

      var dataGridStyle:CSSStyleDeclaration = StyleManager.getStyleDeclaration("DataGrid");
      dataGridStyle.setStyle("headerColors", [0x694845,0x691E19]);
      dataGridStyle.setStyle("alternatingItemColors", [0xF1F1F1,0xFFFFFF]);
      dataGridStyle.setStyle("rollOverColor", 0xDEDEDE);

      Is there some easier/better way to do this? I would really like to be able to change styles on the fly - or at least not having to compile a file with updated ActionScript code to change the background color of a component.

      Any thoughts?