clippy icon indicating copy to clipboard operation
clippy copied to clipboard

Clippy text can only be set at initialization time

Open natacado opened this issue 15 years ago • 3 comments

I'd like to use something like jQuery to update the flashVars attribute of clippy, so it clips different things at runtime. A workaround is to destroy and re-create clippy entirely, but it seems like it'd be possible to make clippy just read from the flashvars as the user clicks?

natacado avatar Aug 03 '09 21:08 natacado

+1 for this one. It's wasteful to initialize a bunch of clippies. As a matter of fact I just crashed Firefox by loading like 100 of them.

theworkinggroup avatar Dec 04 '09 19:12 theworkinggroup

+ 1 , would be cool to have an javascript way to change the text

ericabouaf avatar Aug 27 '10 10:08 ericabouaf

Work around until the flash source can be recompiled is to just remove and recreate the flash object.

    function updateBcpClippy( text ) {
      $('#bcp-clippy').remove();
      var clippy = $('<object id="bcp-clippy" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'+
                 'width="110"'+
                 'height="14"'+
                 'id="clippy" >'+
            '<param name="movie" value="/swf/clippy/build/clippy.swf"/>'+
            '<param name="allowScriptAccess" value="always" />'+
            '<param name="quality" value="high" />'+
            '<param name="scale" value="noscale" />'+
            '<param NAME="FlashVars" value="text='+text+'">'+
            '<param name="bgcolor" value="#fff">'+
            '<embed src="/swf/clippy/build/clippy.swf"'+
                   'width="110"'+
                   'height="14"'+
                   'name="clippy"'+
                   'quality="high"'+
                   'allowScriptAccess="always"'+
                   'type="application/x-shockwave-swf/clippy/build"'+
                   'pluginspage="http://www.macromedia.com/go/getswf/clippy/buildplayer"'+
                   'FlashVars="text='+text+'"'+
                   'bgcolor="#fff"'+
           '/>'+
           '</object>');
      $(bcp_textarea).after( clippy );
    }

harking avatar Sep 19 '11 15:09 harking