Flash动作脚本
我想用动作脚本编写一个应用程序。
应用程序会将 jQuery 附加到页面,如果附加,则立即将其复制到系统剪贴板。我有这段代码:
jQuery:
$(document).ready(function(){
$('#obsah').append('<object width="100" height="100" id="copysw" align="middle"><param name="movie" value="cp.swf" /><PARAM NAME=FlashVars VALUE="hodnota=something"></object>');
});
和动作脚本
but.onRelease = function() {
System.setClipboard(hodnota);
};
but.onRelease();
但它不起作用。我仍然必须单击 Flash 窗口才能执行此操作。我还尝试通过 jQuery 单击 Flash。
$(document).ready(function(){
$('#obsah').append('<object width="100" height="100" id="copysw" align="middle"><param name="movie" value="cp.swf" /><PARAM NAME=FlashVars VALUE="hodnota=something"></object>');
$('#copysw').click();
});
但对我来说没有任何作用。请给我一些如何做到这一点的提示。非常感谢。
I want to write an application in action script.
The application will appended with jQuery to the page and if it is appended, copy it immediately to the system clipboard. I have this code:
jQuery:
$(document).ready(function(){
$('#obsah').append('<object width="100" height="100" id="copysw" align="middle"><param name="movie" value="cp.swf" /><PARAM NAME=FlashVars VALUE="hodnota=something"></object>');
});
And Action Script
but.onRelease = function() {
System.setClipboard(hodnota);
};
but.onRelease();
But it's not working. I still must click on a flash window to do this operation. I also trying click on a flash via jQuery.
$(document).ready(function(){
$('#obsah').append('<object width="100" height="100" id="copysw" align="middle"><param name="movie" value="cp.swf" /><PARAM NAME=FlashVars VALUE="hodnota=something"></object>');
$('#copysw').click();
});
But nothing worked for me. Please give me some tips how to do this. Thank you very much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该查看此链接 ZeroClipBoard 了解如何复制到剪贴板。
尽管它受到限制,但出于充分的理由,仅在用户触发操作时进行复制......例如单击。
You should check this link ZeroClipBoard for learning how to copy to clipboard.
Although it is limited,for good reasons, to only copy when the user trigger the action... such as click.