title: how to load fonts in flex 4.6 windowed application
body: <p>I have a window application that i have developed in flex sdk 4.6 . I have the same version in  web based application. In this application i am loading external swf font file. In web application everything is working fine but font is not loaded in window application.</p>
  
  <p>Below is the code for loading the fonts..</p>
  
  <pre><code>package com
  {
      import adobe.utils.CustomActions;
  
      import flash.display.Loader;
      import flash.display.LoaderInfo;
      import flash.events.Event;
      import flash.events.EventDispatcher;
      import flash.events.IOErrorEvent;
      import flash.net.URLRequest;
      import flash.text.Font;
  
      import injectors.CentralInjector;
  
      import mx.core.FontAsset;
  
      public class LF extends EventDispatcher
      {
          public function LF()
          {
  
          }
          public function avaliable(style:String):Boolean{
              var embeddedFonts:Array = Font.enumerateFonts(false);           
              for(var i:Number = 0; i &lt; embeddedFonts.length; i++){
                  var item:Font = embeddedFonts[i];
                  if(item.fontStyle==style){
                      return true;
                  }
              }
              return false;
          }
          public function load(url:String):void{
  //=====url is http://www.mydomain.com/font1.swf=================
              CustomWaitAlert.show(CustomWaitAlert.WAIT,null,"Loading fonts...");
              var loader:Loader = new Loader();
              var loaderInfo:LoaderInfo = loader.contentLoaderInfo;
  
              loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioerror);
              loaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
              loader.load(new URLRequest(url));
          }
          private function ioerror(evt:IOErrorEvent):void{
              this.dispatchEvent(new Event("IOERROR"));
          }
          private function onLoadComplete(evt:Event):void{
              var embeddedFonts:Array = Font.enumerateFonts(false);
              this.dispatchEvent(new Event("COMPLETE"));
              CustomWaitAlert.hide();
          }
      }
  }
  </code></pre>