Tag Archives: clipboard

Flash 10 security changes: setClipboard() requires user interaction

This is probably why the click-to-copy share links don’t work with Flash 10:

Setting data on the system Clipboard requires user interaction

In Flash Player 9, ActionScript could set data on the system Clipboard at any time. With Flash Player 10, the System.setClipboard() method may be successfully called only through ActionScript that originates from user interaction. This includes actions such as clicking the mouse or using the keyboard. This user interaction requirement also applies to the new ActionScript 3.0 Clipboard.generalClipboard.setData() and Clipboard.generalClipboard.setDataHandler() methods.
What is impacted?

This change can potentially affect any SWF file that makes use of the System.setClipboard() method. This change affects SWF files of all versions played in Flash Player 10 and later. This change affects all non-application content in Adobe AIR?however, AIR application content itself is unaffected.
What do I need to do?

Any existing content that sets data on the system Clipboard using the System.setClipboard() method outside of an event triggered by user interaction will need to be updated. Setting the Clipboard will now have to be invoked through a button, keyboard shortcut, or some other event initiated by the user.

[From Adobe – Developer Center : Understanding the security changes in Flash Player 10]

new mac Flash player breaks most click-to-copy share links

A couple of days ago I noticed that the click-to-copy-to-clipboard share links at Skitch’s site stopped working. I thought it was because of MultiClutch, a program that gives you multi-touch inputs to all Cocoa programs, I wanted to be able to use 3-finger swipes left and right to navigate back and forward in Firefox. I uninstalled that and the input manager it came with and the click-to-copy links still didn’t work. So I think about it more, and since I know how these click-to-copy links work pretty well, I know that most of them depends on Flash to copy to clipboard, and then it occurred to me that I had upgraded Flash to version 10.

I then downgraded it back to version 9 and the click-to-copy links now all work again. 🙂 So if you’re googling the same problem, check your Flash version (about:plugins), and see if it’s version 10, if so, downgrade it back to 9.

Rails plugin/helper to provide “click to copy text field” (to clipboard)

You often see sites with text fields of share links in various different formats, like Skitch provides links to share the images you skitch, they look like this:

Skitch.com > andrewng > Energy Saver
Uploaded with plasq‘s Skitch!

You often click the text box or a copy button next to it and the content is copied to your clipboard so you can paste it into a tweet, a blog or forum post and what not.

I needed something like this for one of my projects, it is pretty easy to do, and there are things you can use to do this. However there isn’t a super simple way to do this in Rails, maybe it’s so simple that nobody bothered to publish a plugin. Well, just for kicks I’ve created a plugin that lets you do exactly this by using a cilick_to_copy_text_field_tag helper in your views. This plugin requires jQuery or jRails, neither of which is part of standard Rails, but they are pretty easy to add to any Rails project.

The plugin is hosted here: http://github.com/ayn/click_to_copy_text_field/tree/master, the README pretty much tells all you need to know to use it.