Flex中如何在用户按住TextArea滚动条(横竖方向)拖动时显示ToolTips

main.mxml

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Applicationxmlns:mx="http://www.adobe.com/2006/mxml"
  3. layout="vertical"
  4. verticalAlign="middle"
  5. backgroundColor="white">
  6. <mx:Script>
  7. <![CDATA[
  8. private function textArea_scrollTipFunc(direction:String, position:Number):String {
  9. var str:String;
  10. switch (direction) {
  11. case "horizontal":
  12. str = position + "/" + textArea.maxHorizontalScrollPosition;
  13. break;
  14. case "vertical":
  15. str = position + "/" + textArea.maxVerticalScrollPosition;
  16. break;
  17. }
  18. return str;
  19. }
  20. ]]>
  21. </mx:Script>
  22. <mx:Stringid="lorem" source="lorem.txt" />
  23. <mx:ApplicationControlBardock="true">
  24. <mx:FormstyleName="plain">
  25. <mx:FormItemlabel="showScrollTips:">
  26. <mx:CheckBoxid="checkBox" selected="true" />
  27. </mx:FormItem>
  28. </mx:Form>
  29. </mx:ApplicationControlBar>
  30. <mx:TextAreaid="textArea"
  31. text="{lorem}"wordWrap="false"
  32. showScrollTips="{checkBox.selected}"
  33. scrollTipFunction="textArea_scrollTipFunc"
  34. width="100%"
  35. height="100%"/>
  36. </mx:Application>

你可能感兴趣的:(xml,Flex,Adobe)