[ Embed(source= "../lib/font1.swf")]private varFont1:Class;
[ Embed(source= "../lib/font2.swf")]private varFont2:Class;public functionTest2()
{//第一种嵌入方式(运行时加载swf)
var loader1:Loader = newLoader();
loader1.load(new URLRequest("font1.swf"), new LoaderContext(false, ApplicationDomain.currentDomain));
addChild(loader1);var loader2:Loader = newLoader();
loader2.load(new URLRequest("font2.swf"), new LoaderContext(false, ApplicationDomain.currentDomain));
addChild(loader2);
loader2.x= 300;
setTimeout(function():void{
TextField(MovieClip(MovieClip(loader1.content). getChildAt(0)).getChildAt (0)).text = "一二三四五六";
TextField(MovieClip(MovieClip(loader2.content). getChildAt(0)).getChildAt (0)).text = "一二三四五六";
},1000);//第二种嵌入方式(加入swc)
var text1:MovieClip = newTestFont1();
addChild(text1);
text1.y= 50;
TextField(text1. getChildAt(0)).text = "一二三四五六";var text2:MovieClip = newTestFont2();
addChild(text2);
text2.x= 300;
text2.y= 50;
TextField(text2. getChildAt(0)).text = "一二三四五六";//第三种嵌入方式(编译时嵌入swf)
var text3:MovieClip = newFont1();
addChild(text3);
text3.y= 100;var text4:MovieClip = newFont2();
addChild(text4);
text4.x= 300;
text4.y= 100;
setTimeout(function():void{//text3是封装的一个壳,子元件是loader,loader里边才是这个swf
Object(text3).getChildAt(0).content. getChildAt(0).getChildAt(0).text = "一二三四五六";Object(text4).getChildAt(0).content. getChildAt(0).getChildAt(0).text = "一二三四五六";
},1000);