0 Replies Latest reply on Oct 19, 2009 8:49 AM by Syam Lal

    loadStyleDeclarations "COMPLETE" event not firing if the font is taking from cache

    Syam Lal

      HI,

       

           I am using runtime style sheet to load fonts. Here is my code.

       

      /////////////////////////////////////////////////////////////////////////////////

      var arr=[Arial, Tahoma, Arial, Arial, Times new Roman]

       

      loadRuntimeStyleSheet( txtArea0, myStyle, arr[0]);

      loadRuntimeStyleSheet( txtArea1, myStyle, arr[1]);

      loadRuntimeStyleSheet( txtArea2, myStyle, arr[2]);

      loadRuntimeStyleSheet( txtArea3, myStyle, arr[3]);

      loadRuntimeStyleSheet( txtArea4, myStyle, arr[4]);

       

      private function loadRuntimeStyleSheet(txtArea:MoveableTextArea, StyleName:String, lFontName:String):void{               
                   var MyStyleSheetEvtDispatcherObj:MyStyleSheetEvtDispatcher = new MyStyleSheetEvtDispatcher(txtArea, StyleName, FontName);
      }

      //////////////////////////////////////////////////////////////////////////////////

       

       

      If we use like this,"txtArea0", "txtArea1" and "txtArea4" only will get the font. The textAreas having repeated font Arial will not.

      Because once the arial font is in cache, the "StyleEvent.COMPLETE" event will not fire.

      If we use some random value with the url, it will take a lot of time.

       

       

      I am attaching my "MyStyleSheetEvtDispatcher.as" file which am using to load runtime style sheet.  Plz Plz help..