![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: as3, dynamic, embed, font |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| Setup a class that will be the reference point to the font you want to load... Code: package {
import flash.display.Sprite;
public class NavItemFont extends Sprite {
[Embed(source='C:/WINDOWS/Fonts/FRAMDCN.TTF', fontName='NavItemFont', unicodeRange='U+0020-U+002F,U+0030-U+0039,U+003A-U+0040,U+0041-U+005A,U+005B-U+0060,U+0061-U+007A,U+007B-U+007E')]
public static var NavItemFont:Class;
}
} Render this out - so it is now NavItemFont.swf Then in another flash app - load the external swf as an asset, and on-load register the font - which will make it global. You can now change NavItemFont.swf externally and it will change in your app everywhere. Code: internal function loadAsset(location:String):void {
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
_loader.load(new URLRequest(location));
}
internal function onLoadComplete(e:Event):void {
var FontLibrary:Class = e.target.applicationDomain.getDefinition("NavItemFont") as Class;
Font.registerFont(FontLibrary.NavItemFont);
} __________________ Day Cares | Golf Courses | Disc Golf Courses | Campgrounds | Ice Rinks | Paintball Fields | Dentists | Plastic Surgeons | Aging Jokes Catholic Churches | Lutheran Churches | Methodist Churches | Episcopal Churches | Clean Jokes |
| The Following User Says Thank You to ccoonen For This Useful Post: | ||
TeraTask (12-12-2007) | ||
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |