7 Replies Latest reply on Jan 22, 2011 11:57 AM by Ansury

    Flex 4 - Global CSS Selector does not work?

    Allocate180

      Does the Global CSS Selector work in a Flex 4 app?

       

      I have the following defaults.css definitions:

      @namespace s "library://ns.adobe.com/flex/spark";
      @namespace mx "library://ns.adobe.com/flex/mx";

       

      mx|global {
          font-family:embSegoeCFF;
          font-size: 15;
          text-decoration: underline;
      }

       

      /* DefineFont 4 */
      @font-face {
          src: url("fonts/SEGOESC.TTF");
          font-family: "embSegoeCFF";
          embed-as-cff: true;
      }
      @font-face {
          src: url("fonts/SEGOESCB.TTF");
          font-family: "embSegoeCFF";
          font-weight: bold;
          embed-as-cff: true;
      }

       

      The styles just do not get applied. I have tried removing the mx| from the definition, I have removed the Spark namespace and used the mx namespace as default and nothing changes.

       

      However, if I apply the style to something like the mx label as so, it will apply to those controls:

      mx|Label {
          font-family:embSegoeCFF;
          font-size: 15;
          text-decoration: underline;
      }

       

      I am using the 4.1 SDK and the project is using the "Halo" theme,  with Flex 3 compatibility turned OFF but has "Use Flash Text Engine in  MX Components" turned ON. I've tried various combinations of compiler  options (Spark Theme, Flex 3 Compatibility on etc.) and nothing seem to  make a difference.

       

      Am I doing something wrong or does this just not work?