I'm trying to use ZeroClipboard in a Rails project, and while the ZeroClipboard.min.js
and ZeroClipboard.swf
load just fine, when I hover over the div
the Flash movie is attached to, I get this error (and nothing works).
Uncaught TypeError: Object #<HTMLEmbedElement> has no method 'setSize'
I'm using, copy-pasted, the example on the GitHub page, plus setting the movie path epath explicitly:
<html>
<body>
<div id="d_clip_button" data-clipboard-text="Copy Me!" title="Click to copy." style="border:1px solid black; padding:20px;">Copy To Clipboard</div>
<script type="text/javascript" src="/assets/lib/ZeroClipboard.js"></script>
<script language="JavaScript">
ZeroClipboard.setMoviePath("/assets/lib/ZeroClipboard.swf");
var clip = new ZeroClipboard.Client('#d_clip_button');
</script>
</body>
</html>
This works if I run this form a non-Rails server, but when I run it either locally or on my remote staging server, I get the above error.
Any ideas?