Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (23 sloc) 0.833 kb
package {
import flash.display.Sprite;
import flash.display.LoaderInfo;
import flash.text.Font;
import flash.external.ExternalInterface;
public class FontList extends Sprite {
public function FontList() {
var params:Object = loadParams();
loadExternalInterface(params);
}
private function loadParams():Object {
return LoaderInfo(this.root.loaderInfo).parameters;
}
private function loadExternalInterface(params:Object):void {
ExternalInterface.marshallExceptions = true;
ExternalInterface.addCallback("fonts", fonts);
ExternalInterface.call(params.onReady, params.swfObjectId);
}
public function fonts():Array {
return Font.enumerateFonts(true).sortOn("fontName", Array.CASEINSENSITIVE);
}
}
}
Jump to Line
Something went wrong with that request. Please try again.