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

Flex中如何设置CheckBox标签(Label)与主题(theme )颜色的例子

发布时间:2020-12-15 01:20:31 所属栏目:百科 来源:网络整理
导读:? Flex中如何设置CheckBox标签(Label)与主题(theme )颜色的例子 By Minidxer | June 28,2009 接下来的例子演示了Flex中如何设置CheckBox标签(Label)与主题(theme )颜色。 让我们先来看一下Demo( 可以点击这里察看源代码 ): ? xml version = " 1.0 " encod
? Flex中如何设置CheckBox标签(Label)与主题(theme )颜色的例子

By Minidxer | June 28,2009

接下来的例子演示了Flex中如何设置CheckBox标签(Label)与主题(theme )颜色。

让我们先来看一下Demo(可以点击这里察看源代码):

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application?name="CheckBox_color_test"
  3. ? ? ? ? xmlns:mx="http://www.adobe.com/2006/mxml"
  4. ? ? ? ? layout="vertical"
  5. ? ? ? ? verticalAlign="middle"
  6. ? ? ? ? backgroundColor="white">
  7. ?
  8. ? ? <mx:Style>
  9. ? ? ? ? CheckBox {
  10. ? ? ? ? ? ? fontWeight: bold;
  11. ? ? ? ? ? ? iconColor: green;
  12. ? ? ? ? }
  13. ?
  14. ? ? ? ? .selectedStyle {
  15. ? ? ? ? ? ? color: green;
  16. ? ? ? ? ? ? textRollOverColor: green;
  17. ? ? ? ? ? ? textSelectedColor: green;
  18. ? ? ? ? ? ? themeColor: green;
  19. ? ? ? ? }
  20. ?
  21. ? ? ? ? .unselectedStyle {
  22. ? ? ? ? ? ? color: red;
  23. ? ? ? ? ? ? textRollOverColor: red;
  24. ? ? ? ? ? ? textSelectedColor: red;
  25. ? ? ? ? ? ? themeColor: red;
  26. ? ? ? ? }
  27. ? ? </mx:Style>
  28. ?
  29. ? ? <mx:Script>
  30. ? ? ? ? <![CDATA[
  31. ? ? ? ? ? ? private function checkBox_change(evt:Event):void {
  32. ? ? ? ? ? ? ? ? var tgt:CheckBox = evt.currentTarget as CheckBox;
  33. ? ? ? ? ? ? ? ? if (tgt.selected) {
  34. ? ? ? ? ? ? ? ? ? ? tgt.styleName = "selectedStyle";
  35. ? ? ? ? ? ? ? ? } else {
  36. ? ? ? ? ? ? ? ? ? ? tgt.styleName = "unselectedStyle";
  37. ? ? ? ? ? ? ? ? }
  38. ? ? ? ? ? ? }
  39. ? ? ? ? ]]>
  40. ? ? </mx:Script>
  41. ?
  42. ? ? <mx:CheckBox?id="checkBox"
  43. ? ? ? ? ? ? label="CheckBox"
  44. ? ? ? ? ? ? selected="false"
  45. ? ? ? ? ? ? styleName="unselectedStyle"
  46. ? ? ? ? ? ? change="checkBox_change(event);"?/>
  47. ?
  48. </mx:Application>

(编辑:李大同)

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

    推荐文章
      热点阅读