开发者

actionscript 3.0: dynamically load fonts

with actionscript 3.0 it is possible to embed a font in a single swf file.

but is it al开发者_如何学Goso possible to load this swf after the main movie has started or do they need to be loaded at the beginning?

thanks!


The easiest thing is to embed them in a stylesheet (.css)

@font-face {
    src: url("../assets/MyriadWebPro.ttf");
    fontFamily: myFontFamily;
}

(http://livedocs.adobe.com/flex/3/html/help.html?content=fonts_04.html)

Compile it separately (in Flash Builder, right-click the .css and select Compile CSS to SWF), and load it when you need it (StyleManager.loadStyleDeclarations)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜