i'm trying to implement the example found here:
I have successfully shared movieclips but the fonts don't seem to be available.
I am using AS3 for Flash - not Flex.
Thanks, Josh
i'm trying to implement the example found here:
I have successfully shared movieclips but the fonts don't seem to be available.
I am using AS3 for Flash - not Flex.
Thanks, Josh
just found the answer. when importing you need to register the font.
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"
);
}