YOUR FEEDBACK
Verizon Becomes a Counter-Android Linux Convert
JNels wrote: Hey - Jeffrey Nelson here at Verizon Wireless. Not a bit of ...


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
MXDJ TOP LINKS YOU MUST CLICK ON !


Adding Right-Click Functionality to Captivate Content
Instead of trying to avoid right-click events, I have come up with a solution that simulates right-click functionality

Digg This!

Page 1 of 3   next page »

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 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.

Configuring the HTML and CSS for a Shield
There is no way to stop the Flash Player context menu from appearing when it detects a right-click, but there are ways to stop the player from realizing that a right-click event has occurred. One way of doing this is to make the user think they clicked a Flash object when instead they clicked an invisible object placed in front of it. This way the invisible object acts as a shield that protects the Flash object from being clicked.

Before creating the "shield" layer, you must properly configure the Captivate object. Adjust the standard HTML output that Captivate generates with the following simple modifications:

  • Set the object's id attribute to "cp".
  • Add the wmode parameter and set it to "transparent".
  • Add the embed tag with the swliveconnect attribute set to "true".
After making these changes, your HTML code for the Captivate object should look like the following (with your own width, height, and filename values):

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=6,0,29,0" width="303" height="320" id="cp">

<param name="movie" value="right-click-functionality.swf">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="loop" value="0">
<param name="wmode" value="transparent">
<param name="AllowScriptAccess" value="always">

<embed src="right-click-functionality.swf" AllowScriptAccess="always" width="303"
height="320" loop="0" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" menu="false" swliveconnect="true"></embed>
</object>

Now that you have set up the movie object correctly, add the shield layer on top of it. Start by inserting the following HTML just above the object tag:

<div id="shield"><img src="transparent.gif" class="shield" galleryimg="no">
</div>

The shield layer contains a transparent image that stops any mouse clicks from reaching the Flash application. Setting the galleryimg attribute to "no" prevents Internet Explorer from displaying the Image toolbar that appears when a user hovers over an image with the mouse.

The CSS for the shield image, shield layer, and Captivate content is quite simple:

div#shield {
     z-index: 2;
     position: absolute;
     display: none;
}

img.shield {
     width: 100%;
     height: 100%;
}

#cp {
     z-index: 1;
     position: relative;
}

You can add the CSS directly to the styles defined in the head of the HTML file, or place them in an externally linked style sheet.

This code sets the transparent GIF file to occupy 100% of the space of the shield layer. The shield layer is set so that it will not appear by default, and its position is set to "absolute". The Z-index property specifies for the browser how to stack components on the screen. Because the shield must be on top of the Captivate SWF file, you must set the shield's Z-index higher.

Setting Up the Captivate Source File
I used JavaScript to create most of the functionality in this solution. The JavaScript code positions the shield, turns it on and off, and decides if the user right-clicked in the appropriate area.

Before you can use the JavaScript code, you need some information from the Captivate content. You need to specify when the JavaScript should show the shield and where the user must click to advance to the next slide.


Page 1 of 3   next page »

About Steven Shongrunden
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.

LATEST FLEX STORIES & POSTS
JavaOne 2008: Sun Talks Up its Late-to-the-Party AIR-Silverlight Rival
At Java One this week Sun has been selling its year -old-but-still-upcoming - and definitely late-to-the-party - Adobe AIR- and Microsoft Silverlight-competitive JavaFX Rich Client environment as a potential revenue-generator capable of putting ads on mobile applications and JavaFX Scri
Two great PDF creators
I like reading stuff in pdf format. But it's even better if you can easily create pdf files. By easily I mean a button click. Literally.Since I have Adobe Acrobat, my Microsoft Word and PowerPoint just have an extra menu to create it. But it's kinda boring. Let me share with you a cou
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
Facelift Your SOA with Rich Internet Applications
We are entering an era of Rich Internet Applications (RIA) and enhancing the user experience of consumers of the services becomes an important part in designing and implementing SOA. But if you decide to develop rich clients, you'll be facing the dilemma - which way to go - remain with
Adobe Flash Player 10 Public Beta Now on Adobe Labs
Today, Adobe announced the immediate availability of Adobe Flash Player 10 beta as a free download from Adobe Labs. Adobe Flash Player 10 beta, code named 'Astro', builds on the capabilities of the world's most ubiquitous application runtime with new support for custom filters and effe
A Runtime Integration Approach to Application Development
This pattern is a hybrid of plug-in and event-driven architecture to integrate individual plug-ins together to come up with the Plug-in Integrator Pattern. This pattern leverages the benefits of both these well-known architectures to provide an optimal solution to build an enterprise-r
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE