【www.gdgbn.com--文本特效】

在Flash IDE下..我们直接使用txt.html = "这里显示一张库里的图片";即可把库里的图像显示到文本框内,而在AS工程下...我们一样可以做到这样的功能...
package {      

  import flash.display.Sprite; 

       import flash.text.*;   

             public class EmbedImageForTextField extends Sprite      

 {           

 [Embed(source="image.png")]           

 private var yellow:Class;          

  public function EmbedImageForTextField()      

      {               

var t:TextField = new TextField();               

 t.htmlText = "这里显示一张库里的图片";  

     addChild(t);  

          }    

       }  

  }  使用Embed嵌入图片文件后..
我们一样可以使用img标签的src属性来指定嵌入的图片资源..
不过在指定的时候..需要以"所在类名_变量名"的形式来指定..
上例中:
所在类名为EmbedImageForTextField
变量名为yellow
那指定的时候就需要写为"EmbedImageForTextField_yellow";

本文来源:http://www.gdgbn.com/wangyetexiao/20388/