Flash笔记之htmlText

 

1.先看textFiled 注意href=\%event:444444一定要加\ 代表转意。结果:回复清风庄的吴老三

  var text:String ="回复清风庄的Nfont color='#FF0000'UNa href=\%event:444444\%UNuU吴老三N/uUN/aUN/fontU。"
   text = replace(text,"N","<");
   text = replace(text,"U",">");
   text = replace(text,"%","'");
   tf.addEventListener(TextEvent.LINK,txtLink);
   tf.htmlText = text;

2.如果从xml中读取  不需要在家转意\        结果:回复清风庄的吴老三

  text = data.@name

  text = 拜访清风庄的Nfont color='#FF0000'UNa href=%event:444444%UNuU吴老三N/uUN/aUN/fontU

  text = replace(text,"N","<");
  text = replace(text,"U",">");
  text = replace(text,"%","'");
  tf.htmlText = text;

你可能感兴趣的:(flash,string,xml)