views:

26

answers:

1

hii....

I am working on a as3 project in which the user select a font from Combo Box and that font SWF should be loaded Dynamically and then i need to change the font of the Dynamic text field.

I have swf font files downloaded from www.isarie.com

My question is that how can i load the font swf dynamically from server and add them to the library and how can i use that swf to change the font of dynamic text field.

if there are embedded fonts in library the i can access them using this- --

var fontList:Array = Font.enumerateFonts();
for( var i:int=0; i<fontList.length; i++ )
{
    trace( "font: " + fontList[ i ].fontName );
} 

But How to use dynamically loaded Font swf as a font type.

Thanks...

+1  A: 

If you know font class name, so:

 var fontClass:Class = swfLoader.contentLoaderInfo.applicationDomain.getDefinition("FontClassName") as Class;
    Font.registerFont(fontClass);

otherwise you can use FontLoader class by Denis Kolyako, you can get it here: http://etcs.ru/pre/FontLoaderDemo/

Dmitri Semenov
I used FontLoaderDemo and it works ... Thanks.......
S M ADIL