
If you have used Macromedia Captivate to create interactive software training simulations, you have probably come across a situation where you needed to simulate a right-click event. Unfortunately, the current version of Macromedia Captivate cannot directly support this functionality because Macromedia Flash Player uses the right-click event to trigger the player menu, which enables you to change player settings or zoom in and out of the SWF file that is playing. This restriction can be frustrating if your demonstration or simulation needs to show that your software has functions only available by performing a right-click action.
Instead of trying to avoid right-click events, I have come up with a solution that simulates right-click functionality. This article explains my solution, which incorporates elements of HTML, CSS, and JavaScript.
To complete this tutorial you will need to install the following software and files:
This code was developed and tested exclusively with Microsoft Internet Explorer 6 on Windows XP; compatibility with other versions or browsers is unknown
right_click_sample.zip (ZIP, 420K)
Open right-click-functionality.htm in a browser to see the solution
The reader should be comfortable with basic HTML, CSS, and JavaScript.
When a user right-clicks any Flash element embedded in a web page, Flash Player automatically displays its context menu. This context menu gives the user the option to view and change the player's current settings. In Flash MX 2004 and Flash 8, developers can modify this menu and add new options, but there is still no way to remove the menu completely. Because Macromedia Captivate output is based on the Flash file format, the same context menu appears when a user right-clicks a Macromedia Captivate demonstration or simulation, thus limiting Macromedia Captivate's functionality to simulate only the left-click action.
After a discussion about this issue appeared on the Macromedia Captivate support forums, Macromedia Captivate users came up with a few alternatives for simulating right-click functionality in their demos and simulations:
There are some situations where one of these alternatives might work, but if you are looking for a solution closer to the real experience of a right-click, these methods are obviously not enough.
Another alternative is to use a series of tricks and processes specific to Microsoft Internet Explorer 6. Using the method described in this article, you can simulate right-click events with the help of HTML, CSS, and JavaScript.
Steven Shongrunden has been developing leading-edge e-learning solutions for the past three years. He is the owner of Sun City Design, an Internet marketing and consulting firm in Canada. He manages all aspects of the company's web development and technical training solutions.