Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Clippy is a very simple Flash widget that makes it possible to place arbitrary text onto the client's clipboard.
Pull request Compare This branch is 1 commit ahead of mockko:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

jQuery-enabled Clippy - Helping you copy text to your clipboard

Source Code: Modified By: why404 Based On:

This version of Clippy makes friends with (and requires) jQuery. Only the button is displayed; showing “copy to clipboard” and “copied!” texts is up to the user.

Here's the code I use to insert Clippy (need load jQuery and jQuery.clippy.js first):

var $copy = $('#copy-button'), $copyLabel = $('#copy-button-label');
$copy.clippy('/static/clippy.swf', {'width':14, 'height':14}).bind({
  'clippycopy': function(e, data) {
    data.text = getRunURL();
  'clippyover': function() {
    $copyLabel.html("copy to clipboard");
  'clippyout': function() {
  'clippycopied': function() {

Clippy accepts a single FlashVar called target and uses $.trigger to trigger the following events on it: clippycopy (return the text to copy), clippyover (button hovered), clippyout (button unhovered), clippycopied (button clicked). This code has actually been compiled from the following CoffeeScript:

Installation (Pre-Built SWF)

If you want to use Clippy unmodified, just copy build/clippy.swf to your public directory or wherever your static assets can be found.

Installation (Compiling)

In order to compile Clippy from source, you need to install the following:

The haXe code is in clippy.hx, the button images are in assets, and the compiler config is in compile.hxml. Make sure you look at all of these to see where and what you'll need to modify. To compile everything into a final SWF, run the following from Clippy's root directory:

swfmill simple library.xml library.swf && haxe compile.hxml

If that is successful, copy build/clippy.swf to your public directory or wherever your static assets can be found.

Please note that I haven't been able to build a working SWF using haXe 2.06 on OS X. Using haXe 2.05 works fine.


If you'd like to hack on Clippy, start by forking my repo on GitHub:

The best way to get your changes merged back into core is as follows:

  1. Clone down your fork
  2. Create a topic branch to contain your change
  3. Hack away
  4. If you are adding new functionality, document it in
  5. If necessary, rebase your commits into logical chunks, without errors
  6. Push the branch up to GitHub
  7. Send me a pull request for your branch


MIT License (see LICENSE file)

Something went wrong with that request. Please try again.