|
|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV SYS-CON.TV WEBCASTS |
MXDJ TOP LINKS YOU MUST CLICK ON ! Captivate
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
Mar. 1, 2006 12:00 PM
Digg This!
Page 2 of 3
« previous page
next page »
I created a special SWF file to handle this responsibility (see the right-click-box.swf file in the sample file at the beginning of this article). Think of this SWF file as Captivate's built-in Click Box. When the animation appears in the Timeline, it specifies the JavaScript to enable right-click functionality. If a slide in your Captivate content requires a right-click to advance, use the following steps as you author your Captivate content:
After following these steps and publishing your Captivate content as a SWF file, you are ready finally to implement the JavaScript that brings everything together. Note: Moving data from Captivate to JavaScript in this fashion is outside the scope of this article. Interested Flash developers can examine the right-click-box.fla sample file to see how I do this.
Implementing the JavaScript The first section is called when the right-click-box.swf animation starts to play in the Timeline:
// Array to hold data sent by the right-click box we inserted in Captivate When the second section runs, it calls the rightClickToAdvance() function, which enables and positions the shield (Figure 1):
function rightClickToAdvance(){ The last section of code indicates to the browser that right-clicks should call the userRightClicked() function (Figure 2). The userRightClicked() function determines whether the user right-clicked a location inside the target area of the right-click box. If the user's right-click was not in the target area, nothing happens. If the user right-clicks the target area, the userRightClicked() function disables the shield, advances the Captivate simulation to the next slide, and returns functionality back to normal: Page 2 of 3 « previous page next page » LATEST FLEX STORIES & POSTS
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||