There are options for inter-regional assets:
// SWF inbound scripting policy: page domains that the SWF should trust. (single string or array of strings) trustedDomains: [window.location.host],
See: https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/instructions.md
Also: the current main branch (2.x) registers cross-domains on the console if you set the debug value to true in config.
I have had some success using a version of the SWF file that supports cdn. But after making some changes, it mysteriously stopped working locally, but it worked on my intermediate server.
This is my configuration:
ZeroClipboard.config({ moviePath: '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.3.2/ZeroClipboard.swf', forceHandCursor: true, debug: true });
Also see this jsfiddle:
http://jsfiddle.net/rimian/45Nnv/
If you still have problems, you can go from SWF to the console. To do this, you need to compile flash memory from the zeroclipboard source to swf using grunt mxmlc . Just send the log event to the script action (compile and copy it into your project) and respond to it in js:
For example, in ZeroClipboard.as :
// constructor, setup event listeners and external interfaces public function ZeroClipboard() { ... // Get the flashvars var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters; dispatch("log", flashvars); ... }
Then in your js:
zeroclipboard = new ZeroClipboard($('.mybuttons')) zeroclipboard.on('log', function(client, args) { console.log('log:', args)});
Rimian
source share