当浏览器是谷歌浏览器时,Ctrl + C不能在flash播放器(swf文件)中工作 [英] Ctrl + C not working in flash player(swf file) when browser is Google Chrome
问题描述
我的项目是在Flex3中开发的,
<<< Site Link Removed>>
你可以在这里查看,我面对的问题是,复制(Ctrl + C)当swf在chrome浏览器中运行时,屏幕textarea的内容。
假设,我必须在舞台上添加一些文本,所以左边的文本区域被打开我不能复制在文本区域写的文本,虽然通过右键单击文本区域,并选择复制选项,多数民众赞成在工作,但我的客户要求通过使用Ctrl + C复制内容,虽然它的工作非常罚款与其他浏览器,
只chrome不支持复制(Ctrl + c),虽然选择所有(Ctrl + A)正在工作
所以这个东西,我打我讨论,可能有人也有同样的问题,
提前感谢你, / p>
Ankur Sharma
ctrlKey
来查看它是否关闭,并使用 System.setClipboard(source.text);
来设置剪贴板内容。$ b
textArea.addEventListener(KeyboardEvent.KEY_DOWN,onKeyDown);
private key onKeyDown(ev:KeyboardEvent):void
{
if(ev.keyCode!= 67 ||!ev.ctrlKey)return;
var text:String = textArea.text;
System.setClipboard(text);
$ / code>
请注意,有时奇怪的事情可能会同时发生,例如文字内容消失等等。你可能需要解决这个问题!
i have my project developed in Flex3,
<<Site Link Removed now>>
You can check it here, the problem i am facing is, copying(Ctrl + C) the content from screen textarea when the swf is running in chrome browser.
suppose, i have to add some text on the stage, so the text area which is opened on the left side, i can't copy the text written in text area, although by right clicking in text area, and selcting the copy option, thats working, but my client has asked for copying the content by using Ctrl + c, although it's working very fine with other browsers,
only chrome is not supporting copying(Ctrl + c), although selecting all(Ctrl + A ) is working
so this the thing, which i thot i shd discuss, may b someone also hav same problem,
Thanking u all in advance,,
Ankur Sharma
Use KeyboardEvent.KEY_DOWN
to detect "C" being pressed. Then check for ctrlKey
to see if it is down, and use System.setClipboard(source.text);
to set the clipboard content.
textArea.addEventListener (KeyboardEvent.KEY_DOWN, onKeyDown);
private function onKeyDown ( ev : KeyboardEvent ) : void
{
if (ev.keyCode != 67 || !ev.ctrlKey) return;
var text:String = textArea.text;
System.setClipboard( text);
}
Beware, though: Sometimes odd things can happen simultaneously, like the text content disappearing and such. You might have to work around that!
这篇关于当浏览器是谷歌浏览器时,Ctrl + C不能在flash播放器(swf文件)中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!