setClipboard

<?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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章