Flex中如何控制鼠标移出RichTextEditor编辑范围外的时候隐藏其工具栏的例子

By Minidxer | January 21, 2009

接下来的例子演示了Flex中如何控制鼠标移出RichTextEditor编辑范围外的时候隐藏其工具栏。

让我们先来看一下Demo可以右键View Source或点击这里察看源代码):


下面是完整代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3.         layout="vertical"
  4.         verticalAlign="middle"
  5.         backgroundColor="white">
  6.  
  7.     <mx:RichTextEditor id="richTextEditor"
  8.             title="RichTextEditor"
  9.             status="version {richTextEditor.getStyle('version')}"
  10.             showControlBar="false"
  11.             cornerRadius="0"
  12.             width="100%"
  13.             height="100%"
  14.             rollOut="richTextEditor.showControlBar = false;"
  15.             rollOver="richTextEditor.showControlBar = true;" />
  16.  
  17.     <mx:Label text="Roll over the RichTextEditor control above to toggle the control bar." />
  18.  
  19. </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: RichTextEditor | 1 Comment » | Tags: , , ,

Search Posts