zoukankan      html  css  js  c++  java
  • 在Flex中复制文字到操作系统的剪贴板

     这个实例演示了怎么样使用System.setClipboard()静态方法,从一个Flex application中复制文字到操作系统的剪贴板。
    随便在RichTextEditor打些字,然后点击Copy text to clipboard 按钮就复制到剪贴板了,之后就找个能打文本的地方试试吧
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
     layout
    ="vertical"
     verticalAlign
    ="middle"
     backgroundColor
    ="white">

     
    <mx:Script>
     
    <![CDATA[
     import mx.controls.Alert;

     private function button_click():void {
     System.setClipboard(richTextEditor.text);
     Alert.show("Done");
     }
     
    ]]>
     
    </mx:Script>
     
    <mx:RichTextEditor id="richTextEditor"
     text
    ="The quick brown fox jumped over the lazy dog."
     width
    ="100%"
     height
    ="160" />

     
    <mx:ApplicationControlBar dock="true">
     
    <mx:Button id="button"
     label
    ="Copy text to clipboard"
     toolTip
    ="Click here to copy the contents of the RichTextEditor control to the OS clipboard."
     click
    ="button_click();" />
     
    </mx:ApplicationControlBar>

    </mx:Application>
  • 相关阅读:
    线程私有数据
    C
    Zend_Json 简介 --(手冊)
    Spring之AOP实现面向切面编程
    JDBC框架
    NYOJ15-括号匹配(二)-区间DP
    SDUTOJ 贪心 -商人小鑫
    Java 8 类型转换及改进
    java内存结构(执行时数据区域)
    Android Studio 编译Gradle提示编码错误
  • 原文地址:https://www.cnblogs.com/taobataoma/p/1219494.html
Copyright © 2011-2022 走看看