Adobe Captivate currently ships with a 3rd-party JavaScript utility named RightClick.js, which enables the Captivate SWF to detect when a user right-clicks the SWF. While upgrading the Captivate publishing templates, I realized RightClick.js wasn’t built to work with SWFObject 2.x and suffered from a few shortcomings. I modified the Captivate template’s SWFObject code to get around the issue, but marked it down as something to revisit when I have the time.
Now, I’m happy to report I’ve created a replacement for the RightClick.js utility, creatively named SWFRightClick. It uses the same approach to handling right-clicks, but does it with a completely new codebase and a few extra goodies. SWFRightClick is compatible with every edition of SWFObject, and is free to use (MIT license).
Check it out on GitHub. I plan to fold it in to my Captivate publishing templates very soon.
Very nice, but can you show me an example how to do this with Flash?
@marcel Here’s a test page using a Captivate-generated SWF: http://lab.pipwerks.com/swfrightclick/
In your Flash file, create an ExternalInterface callback named “rightClick” (it will be exposed to JS as a method of the SWF). Someone wrote some basic instructions for setting up a SWF to work with RightClick.js, it’s still valid for the Flash/Flex end of things (ignore the JavaScript part of the tutorial).