package import flash display Sprite import flash events MouseEvent imp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.external.*;
import flash.system.System;
public class clipboard extends Sprite
{
public var text :String;
public function clipboard()
{
this.addEventListener(MouseEvent.CLICK, copy );
}
private function copy(text:String):void{
System.setClipboard(this.getText());
}
private function getText():String{
if (ExternalInterface.available) {
//text=ExternalInterface.call("getClipboardText()");
return 'flashdebug';
}else{
return '';
}
}
}
}