Search code examples
javascriptflashuserscriptszclipdownloadify

Fire several flash buttons on a single click


I'm using Zero Clipboard and Downloadify to put certain data into clipboard and call Save As dialog. I want to avoid having to click two buttons, but Flash does not allow taking action with simulated click() from Javascript, only real mouseclicks. Is there a way to "spread" a single click done by user to two flash buttons?

I think I heard somewhere that a click can reach through several layers of elements. I tried putting the two buttons one on top of another (by calling ZClip on the flash object that Downloadify generates), but it doesn't work, only the upper button fires (ZClip), even though the bottom one is able to detect mouseover (changes button color).

I need this for a userscript I'm writing for myself to enhance functionality of an online photoalbum. The idea behind the script is that it tries to guess the category of a currently opened image based on its filename or tags and generates a full path under which I would want to save this image, which is then placed into clipboard so that upon saving I can simply paste it to the filename field saving me the trouble of having to navigate to the desired folder manually every time. Since I'm going for decreasing the amount of clicks, I'd like to have both clipboard operation and Save As dialog to happen at a single click instead of click for copy and right-click for context menu and click to choose "save as".

I'm using Opera 12.17 if it matters.

Edit: It looks like you can call a flash function from outside by Javascript via SWFObject plugin, but that function needs to be declared as external in flash code. I tried looking up the list of available functions in my case, ZClip has none and Downloadify only has unrelated stuff like show/hide/classes, so still no luck.

ZClip has the ability to relay the click event to the object it's glued to, which is on by default, but that still doesn't work in my case, even though I glue it to Downloadify.


Solution

  • Apparently it's impossible, I asked the same question in several places online and got no solution anywhere.

    Still, I solved the problem another way, if I can't fire two buttons at once, I should just add the functionality of one into another. Which I did, adding the ability to copy to clipboard to Downloadify, works perfectly.