views:

155

answers:

4
+4  Q: 

SWF does not load.

ZeroClipboard.setMoviePath( "/zeroclipboard/ZeroClipboard.swf" );
var clip = new ZeroClipboard.Client();
clip.setText( $('textarea#download_me').text() );
clip.glue( 'clip' );

I'm using the popular ZeroClipboard plugin to copy content to user's clipboard. It works perfectly in the dev enviornment as well as on domain1.com but not on domain2.com with EXACTLY the same files and settings!

/zeroclipboard/ZeroClipboard.js loads.

/zeroclipboard/ZeroClipboard.swf does NOT load!

I tried everything but can't get it to work. I'm really confused why it work on domain1 but not on domain2??

How do I resolve this?

Many thanks for your help!

A: 

If this file is located in the same directory as your web page, then it will work out of the box. However, if the SWF file is hosted elsewhere, you need to set the URL like this (place this code after the script tag):

    ZeroClipboard.setMoviePath( 'http://YOURSERVER/path/ZeroClipboard.swf' );

To use the new Rich HTML feature available in Zero Clipboard 1.0.7, you must set the movie path to the new "ZeroClipboard10.swf" file, which is included in the 1.0.7 archive. Example:

    ZeroClipboard.setMoviePath( 'ZeroClipboard10.swf' );

Or, in a custom location other than the current directory:

    ZeroClipboard.setMoviePath( 'http://YOURSERVER/path/ZeroClipboard10.swf' );
daidai
Tried using `ZeroClipboard10.swf` still does not work. Its so weird, I double checked the paths and everything but still it doesn't work on domain1, but works well on domain2!
Nimbuz
A: 

Flash heh. What browser & OS are you running on? I had quite a few issues with a project recently under XP and IE8 when on some machines it simply refused to load SWFs at all. Frustrating...

PS: I also found using ./folder/file.swf notation instead of folder/file.swf to be the resolution sometimes, but I am guessing this is not the case if full url doesn't work.

Ian
A: 

http://kenneth.kufluk.com/blog/2008/08/cross-domain-javascript-to-flash/ may help. Also beware of subdomains, flash can get confused. Also use Flash debug player and Fiddler (or similar) to see what is going on.

Tomas Voracek
A: 

Might want to try Fiddler to see exactly what the request/response looks like for the file.

JoshNaro