加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flex学习笔记 富文本编辑(三)

发布时间:2020-12-15 04:49:54 所属栏目:百科 来源:网络整理
导读:代码: ? xml ? version = "1.0" ? encoding = "utf-8" ? ? s:Application ? xmlns:mx = "library://ns.adobe.com/flex/mx" ? ? ??????????????? xmlns:fx = "http://ns.adobe.com/mxml/2009" ? ? ??????????????? xmlns:s = "library://ns.adobe.com/flex/s

代码:

 
 
  1. <?xml?version="1.0"?encoding="utf-8"?>?
  2. <s:Application?xmlns:mx="library://ns.adobe.com/flex/mx"? ?
  3. ???????????????xmlns:fx="http://ns.adobe.com/mxml/2009"? ?
  4. ???????????????xmlns:s="library://ns.adobe.com/flex/spark"?
  5. ???????????????width="500"?height="500">?
  6. ????<!--这个例子是一个简单的富文本编辑器,标题应用了style样式-->?
  7. ????<fx:Script>?
  8. ????????<![CDATA[ ?
  9. ????????????//是不是在同一文件内就可访问private声明的变量? ?
  10. ????????????private?var?richtext:String?=?"Enter?text?into?the?<b>RichTextEditor?control</b>,?then?click?a?<b><font?color='#0050AA'>button</font></b>?to?display?your?text?as?<i>plain?text</i>,?or?as?<i>HTML-formatted</i>?text."; ?
  11. ????????]]>?
  12. ????</fx:Script>?
  13. ????<fx:Style>?
  14. ????????.white{ ?
  15. ????????????color:?#ffffff; ?
  16. ????????????fontWeight:?bold; ?
  17. ????????} ?
  18. ????</fx:Style>?
  19. ????<mx:VBox?width="100%"?height="100%">?
  20. ????????<mx:RichTextEditor?titleStyleName="white"?id="richText"?title="RichTextEditor"?width="100%"?height="350"?
  21. ???????????????????????borderAlpha="0.15"?creationComplete="richText.htmlText=richtext;"??/>?
  22. ????<s:TextArea?id="textA"?width="100%"?height="100"?/>? ?
  23. ????<mx:HBox>?
  24. ????????<s:Button?label="显示内容"?click="textA.text=richText.text;"/>?
  25. ????????<s:Button??label="显示HTML"?click="textA.text=richText.htmlText;"/>?
  26. ????</mx:HBox>?
  27. ????</mx:VBox>?
  28. ???? ?
  29. </s:Application>?

效果:

?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读