2009-06-19 6 views

Répondre

0

vient de trouver la réponse. Lors de l'importation, vous devez enregistrer la police.

private function onComplete(evt:Event):void { 

    var loaderInfo:LoaderInfo = evt.target as LoaderInfo; 

    loaderInfo.removeEventListener(
    Event.COMPLETE, 
    onComplete 
); 

    var appDomain:ApplicationDomain = loaderInfo.applicationDomain; 

    var thisIsMyFont:Class; 

    try { 

    thisIsMyFont = appDomain.getDefinition(
     "ThisIsMyFont" 
    ) as Class; 

    } catch(ex:Error) { 

    throw new Error(
     "The font could not be found!" 
    ); 

    } 

    Font.registerFont(thisIsMyFont); 

    trace(
    "Now there are " + Font.enumerateFonts().length + " fonts available" 
); 

} 
Questions connexes