`
hereson
  • 浏览: 1444495 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

关于FLASH 中的System.setClipboard()

阅读更多
System.setClipboard()

Availability
SWF files published for Flash Player 6 or later, playing in Flash Player 7 or later.
Usage
System.setClipboard(string:String) : Boolean
Parameters
string A plain-text string of characters to place on the system Clipboard, replacing its current
contents (if any).
Returns
A Boolean value: true if the text is successfully placed on the Clipboard; false otherwise.
Description
Method; replaces the contents of the Clipboard with a specified text string.
//偶的英文不好,看个大概,有了一个复制的功能...

Example
The following example places the phrase "Hello World" onto the system Clipboard:

System.setClipboard("Hello world");
The following example creates two text fields at runtime, called in_txt and out_txt. When you
select text in the in_txt field, you can click the copy_btn to copy the data to the Clipboard.
Then you can paste the text into the out_txt field.
this.createTextField("in_txt", this.getNextHighestDepth(), 10, 10, 160, 120);
in_txt.multiline = true;
in_txt.border = true;
in_txt.text = "lorum ipsum...";
this.createTextField("out_txt", this.getNextHighestDepth(), 10, 140, 160,
120);
out_txt.multiline = true;
out_txt.border = true;
out_txt.type = "input";
copy_btn.onRelease = function() {
System.setClipboard(in_txt.text);//复制文字
Selection.setFocus("out_txt"); //将文字全选
};

 

分享到:
评论

相关推荐

    Flash AS3实现多浏览器兼容复制按钮

    众所周知,在网页中若想实现点击按钮自动复制到剪贴板中可以用以下代码实现: if(window.clipboardData) { ...System.setClipboard("你要复制的内容"); 而网页中要做的是显示并通过flashvars将内容传给Flash。

    Flash AS3实现多浏览器兼容复制按钮[2012-6-24]

    众所周知,在网页中若想实现点击按钮自动复制到剪贴板中可以用以下代码实现: if(window.clipboardData) { ...System.setClipboard("你要复制的内容"); 而网页中要做的是显示并通过flashvars将内容传给Flash。

    Flex中的小技巧备忘

    `Capabilities`类可以提供关于运行时环境的详细信息,包括但不限于操作系统版本、浏览器类型、Flash Player版本等。这对于优化用户体验以及开发跨平台的应用程序非常重要。 1. **操作系统信息**:获取当前设备的...

    解决兼容火狐等其他浏览器里js不能拷贝的问题

    利用flash as3里的System.setClipboard函数解决 兼容火狐等其他浏览器里js不能拷贝的问题 解决只能IE下才能复制的难题 必须http://路径下访问 才能实现效果 修改js里text的id和相关代码 QQ:275481232 msn:...

    flash action script 经典字典教程大全,学flash必备

    flash action script 经典字典教程大全,学flash必备 -- --(递减) ++ ++(递增) ! !(逻辑 NOT) != !=(不等于) !== !==(不全等) % %(模) %= %=(模赋值) & &(按位 AND 运算符) && ...

    FLEX技巧

    1. **复制内容到剪贴板**:在ActionScript中,可以使用`System.setClipboard()`方法将字符串内容复制到剪贴板,如`System.setClipboard(strContent);`。 2. **复制ArrayCollection**:如果你需要复制一个...

    flash_as3.0_常用代码

    System.setClipboard(strContent); ``` 十四、复制 ArrayCollection 使用 `ArrayCollection` 对象可以复制 ArrayCollection,代码如下: ```actionscript var bar:ArrayCollection = new ArrayCollection(); for ...

    复制Input内容的js代码_支持所有浏览器,修正了Firefox3.5以上的问题

    - 在Flash中可以使用System.setClipboard方法直接将内容设置到剪贴板,而这一操作在Flash播放器的10.0版本之后,也受到限制,内容必须在Flash内部完成。 - 通过使用Flash的ExternalInterface功能可以实现Flash和...

    十二个非常有用的Flex函数Source In Flex

    **函数**: `System.setClipboard(strContent);` 此函数用于将指定的字符串内容`strContent`复制到系统的剪贴板中。这在用户界面设计中非常有用,特别是当需要让用户能够快速复制某些文本时。 **示例代码**: ```...

    跨浏览器开发经验总结(四) 怎么写入剪贴板

    System.setClipboard(s); ExternalInterface.call("copyURLCompleted"); ``` 这部分ActionScript代码从JavaScript获取要写入的数据,设置剪贴板内容,然后调用JavaScript函数进行后续处理。 在JavaScript端,你需要...

Global site tag (gtag.js) - Google Analytics