1 Reply Latest reply on Jul 20, 2007 1:33 PM by mitchgrrt

    parseCSS issue

    gdoumenc
      Hi,

      I don't understand the parseCSS method of StyleSheet... Can someone explain me why this code :

      quote:

      var my_styleSheet:StyleSheet = new StyleSheet();
      if (my_styleSheet.parseCSS("p { font-size: 10pt }")) {
      trace("parsed successfully");
      } else {
      trace("unable to parse CSS");
      }


      returns : unable to parse CSS

      Thanks for helping, I'm becomming crazy..!

      PS / I'm using Flex Builder 2 2.0.1. on eclipse Windows
        • 1. Re: parseCSS issue
          mitchgrrt Level 1
          var ss: StyleSheet = new StyleSheet();
          ss.parseCSS("Label.title { fontFamily: Arial; }");
          var styles: Array = ss.styleNames;
          Alert.show("styles " + styles);

          This works. I think your example doesn't work because it's using HTML format instead of Flex format. Flex uses a non-standard format for CSS.