as3代码

package  {
	import flash.display.Sprite;
	import fl.controls.Button;
	import flash.events.MouseEvent;
	import flash.external.ExternalInterface;
	import flash.system.System;

	[SWF(backgroundColor='0xffffff',width='120',height='30',frameRate='29')]
	public class main extends Sprite {

		public function main() {
			var btn:Button = new Button();
			btn.x = 0 ;
			btn.y = 0;
			btn.width  = 120;
			btn.height = 30;
			btn.label = '复制';
			btn.addEventListener(MouseEvent.CLICK,doCopyJSInFo);
			this.addChild(btn);
		}
		private function doCopyJSInFo(event:MouseEvent):void{
			var info:String = ExternalInterface.call('jsCopyInfoFun','copyeleId');
			System.setClipboard(info);
		}
	}
	
}

说明:上面代码实现的是调用js函数jsCopyInfoFun来获取该js函数的返回值。并把这个返回值放到粘贴板中。




下面则是html页面运行上面falsh功能的一个实例(text.swf是上面运行的flash结果文件)

    
        
        test