YOUR FEEDBACK
andy.mulholland wrote: intriguing !!! We have full scale 'Mashup Factories' in Chicago USA and Utrec...


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
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

// Function to handle when the user right clicks on the shield
function userRightClicked() {

// Get the dimensions of the user's click
var clickX = event.clientX + document.body.scrollLeft;
var clickY = event.clientY + document.body.scrollTop;

// Get the dimensions of the right click box
var dimX = eval(rightClickBoxData[0]);
var dimY = eval(rightClickBoxData[1]);
var width = eval(rightClickBoxData[2]);
var height = eval(rightClickBoxData[3]);

// Get the position of the Captivate content relative to the top left corner of the page
var cpX = document.getElementById("cp").offsetLeft;
var cpY = document.getElementById("cp").offsetTop;

// Only advance the slide if the user right-clicked in the correct area
if ((clickX > cpX + dimX) && (clickX < cpX + dimX + width)){
if ((clickY > cpY + dimY) && (clickY < cpY + dimY + height)){

// Advance the slide
window.cp.SetVariable("rdcmndNextSlide","1");

// Get rid of the shield
document.getElementById("shield").style.display = "none";

// Return to normal functionality
document.oncontextmenu = null;
document.onselectstart = null;
}
}

return false;
}

After combining all of these elements, your Captivate content now has fully functional, right-click simulation abilities. If you don't want to code this tutorial from scratch, edit the right-click-functionality-example.htm page and modify the object tag's attributes for filename, width, and height to reflect your Captivate SWF file (Figure 3).

Note: Before running the following Captivate simulation on your local machine, you must make a change in Flash Player 8 settings. New security features in Flash Player 8 stop Captivate from communicating with JavaScript when you view the file on your local hard drive. Follow the instructions in the Breeze Presenter TechNote, Security Warning with Flash Player 8, to change these settings in Flash Player 8 so that you can run these files properly on your local hard drive. This issue does not apply to Captivate content hosted on a web server. The right-click functionality only runs on Microsoft Internet Explorer.

Start simulation of right-click functionality

In the simulation, the prompt asks you to click "Close". Right-click My Computer to see the simulated right-click functionality explained in this tutorial.

Where to Go from Here
This article demonstrated a method of modifying your Captivate content to simulate right-click events. The solution may not be perfect but it's a step in the right direction. I hope it will help take your Captivate projects further and allow you to develop even more effective software simulations.

This code was developed and tested exclusively with Microsoft Internet Explorer 6 on Windows XP; compatibility with other versions or browsers is highly unlikely - or at least unknown at this time. Creating a cross-browser alternative would be very useful to allow non-IE6 users to enjoy this right-click functionality.

If you have any suggestions on how to improve any aspect of this method, including cross-browser support, feel free to contact me at steve@suncitydesign.com. I would be happy to discuss any further enhancements or problems you might have to make this method as useful as possible.

This article originally appeared on www.macromedia.com/devnet. Reprinted with permission.

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
As a speaker at the upcoming AJAX World RIA Conference & Expo, I just received an email from Lindsay over at SYS-CON Events. She just informed me about the coupon code "spkrguestbootcamp" (lower case) that I can use to invite three guests with. I am not planning to bring anyone with me...
Director of Ribbit's Developer Platform, Chuck Freedman, will explore an evolution in web communication. With the growing demand of RIA and voice-over-the-web solutions, developers finally have a full suite of communication APIs to add to Flash. Coding with Ribbit, Freedman will demons...
Hoffman will give a review of traditional web security and explain the intracacies of Resource enumeration attacks in great detail, Injection attacks, and session hijacking as well as a step by step walk through of hacking an AJAX travel site. The intensive, one-day, hands-on training ...
Kevin Lynch, who will be keynoting on October 21, 2008, helped originally coin the term "Rich Internet Application" in 2002. He has been at the center of innovation in Flash and Adobe AIR since their inception, and currently drives Adobe’s technology platform for designers and develo...
Enterprises are enthusiastically embracing the shift from traditional client/server computing to SaaS. Inspired by customers who have embraced the web, developers are using RIA tools to create innovative new on-demand business applications. One important factor in the shift from tradit...
Rich Internet Applications offer the potential to fundamentally change the user experience and in doing so, yield significant business benefits. The theme of this October's AJAX World Conference & Expo 2008 West is 'Beyond AJAX to the RIA Era' and the Call for Papers, which is still op...
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