Question

Right Click Event Handler

Asked by: TimCaturaHouser

Okay all you Flasheads...Here's a doosey...

Does anybody know how to "create" a right click event handler for Flash? ActionScript is supposed to be based on ECMA (which has a right click event handler) but I can find no way to do it.

Grades will be given as follows:

A: Solution w/complete code (1200 pts)
B: Solution w/partial code (900 pts)
C: No Solution w/excellent explaination (600 pts)

I will hold off on grading any submissions for 1 week, or until an A or B submission shows up.

Just saying "it won't work" won't get you anything...

Here is a lead I am following now:

*External script or .com/.exe that flip-flops the mouse button controls
*Script is called from Flash on a ClipEvent or Button Click.

Good Luck!!!


This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2001-05-24 at 15:38:57ID20123960
Tags

click

,

event

,

handler

,

right

Topic

Adobe Flash

Participating Experts
6
Points
300
Comments
11

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. flip flop query
    select * from (select * from tablename order by rownum desc) where rownum <=10 order by rownum desc; Yes, this was required since my table has 80000 records. So a search of only 10 records is easy but they come upside down. A) Why is order by so fast in comparison to a s...
  2. Event handler
    What is an event handler.....? Is there site where I can check out the functions of the event handler.... Any comments will be preferred
  3. Name Flip Flop
    Experts, some how a file that I have with over 55k rows have some of the names flip flopped. First name column has last names in it and vice versa. I know I can do a find and replace for each instance, but, is there a short cut to accomplish this? Please let me know.
  4. Flip flop and Latch--Difference
    Can any one tell what is the clear cut difference between filp flop and a latch. Be careful while you quote the information from the internet as most of it is wrong about htis topic.... any genous out there?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: alanmcclurePosted on 2001-06-01 at 19:28:38ID: 6148010

I have never run accross this before or anyone who wanted to do it.  I looked through every actionscript possibility and there doesn't seem to be one.  The only possible chance you might have is FsCommand.  And if it works, then it will only work with internet explorer on a windows machine and maybe newer netscape browsers on a windows machine.  So here it goes.  You write the code in javascript that will do what you want with the right click.  I am not proficient with javascript, so I won't be able to help you with it, but it sounds like you are, so it shouldn't be a problem for you to do something that simple.  Next, you add the fscommand to the main timeline and copy the javascript and then paste it inside the command box under fscommand in the action panel.  If this doesn't work, which I'm not sure it will, then I think you are out of luck.

Alan

 

by: mousefistPosted on 2001-06-01 at 19:35:05ID: 6148026

a doosey, you say?  i think i saw a tumbleweed blow by!  well, i don't have an answer for you, but i'll tell you what i understand ... maybe it'll inspire some conversation at least.  

well, i guess you know that it's not uncommon to catch the right click event in javascript.  there is a dhtml event, oncontextmenu, to do so ... at least in theory.  the method varies between netscape and ie, but works in the normal case.  you can see a good example in action (don't know how it works on mac, though) at http://website.lineone.net/~mike_mcgrath/ , or in ie5+, a simple
document.oncontextmenu = function(){return false}
will disable the context menu.  

this is fine for most cases, but not flash.  that's because the activex takes the event in flash, not the document.  i think you already understood at least this much when you asked the question, i'm just stating the problem as i understand it.  ok, so you have to catch the event before it gets sent to the flash player.  

btw, i realize that disabling the context menu isn't necessarily what you had in mind, but it's a good basic case for handling the event - if you can stop the event, then you can use javascript to pass an event to flash ... see
http://www.macromedia.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash.html

ok, so this is where it gets tricky.  first, two more links:
http://www.macromedia.com/support/flash/ts/documents/newie55dom.htm
and
http://msdn.microsoft.com/workshop/author/dhtml/reference/events/oncontextmenu.asp

the first of these indicates that it *is* possible to capture the right click to disable the flash context menu in ie5.5 ... which in turn kinda implies that it *isn't* possible when the user has a different browser, not good news.  the second link is some ie5.5 documentation that states under no uncertain terms that the oncontextmenu event applies to the embed tag ... exactly what we need i do believe.  if that's wrong, it would also be possible, in ie5.5, to use "attachEvent" on the object tag, to handle it at that level.  with me so far?  no worry if you aren't, because i just tried, and i couldn't get either of those to work.  no errors, but no results, either.  i'm not terribly bright, though, so you may want to take a crack at this yourself ... if you can supress the context menu, i could pass the event to flash.  

i'll try a couple of other angles, but it doesn't look pretty ... the best case scenario i see is getting it to work only in ie 5+ ... and that possibly only for windoze.  i know you said "it won't work" isn't worth anything ... but after a week of silence i hope the links help you out a bit.  good luck!

m.


 

by: TimCaturaHouserPosted on 2001-06-03 at 17:42:39ID: 6151193

Wow! Thanks for the great ideas! I can live with the er,
forcing of IE (to get the job done).

Sorry that I haven't responded right away, was teaching
a few classes this weekend, and just got out.

Sorry that I am limited to 300 points (native).

Between the ideas, I don't have any heartburn of creating
a second question and awarding you both. Time right now for a little food and then paw around tomorrow.

Tcat

 

by: JaymolPosted on 2001-06-04 at 03:21:16ID: 6151959

Alternatively, you can patch the ActiveX component that holds the menu, but bear in mind that this must be done on every target machine.

John.

 

by: MattSimmonsPosted on 2001-06-08 at 10:30:03ID: 6168701

Okay, here it goes....

You really cant' have a rightClick event handler per se, but what you can do is "fake out" the Flash player. You will need some VB or C++ knowledge to pull this off. Here is how:

Say we wanted a button that would react to a "right click"

On the frame that contains the button add this line of ActionScript:

fsCommand("exec", "flip.exe");

Okay, this statement executes a program, flip.exe, that flips the mouse buttons. This is not a hard program to write in VB or C++. It is contained in the same directory as the flash movie itself. You could also you some dot syntax to have in a seperate folder, such as:

fsCommand("exec", "..\components\flip.exe")

Here the program would be in the "components" folder, one level above the flash movie. Anyway....

At this point in the movie, the mouse buttons have been reversed. Now any left click is handled as a right click by the flash player, and vica versa. WARNING----this is a system wide change!!! If the user bails out at this point, their mouse buttons are reversed system wide. This could really peave some users, so be careful.

NOTE: You may also want to hide the Player menu that is displayed when a user right Clicks the Player window with the following command:

fsCommand("showmenu", "false");

This will eliminate the menu except for the "About Flash..." If you want to kill that, check out this tutorial. http://www.flashkit.com/tutorials/Projector/Manipula-MadWolfZ-8/index.shtml

Okay, on to the next step. Now that we have flipped the mouse buttons, we need to flip them back. No problem. Add this Action script to the button that is right clicked or to the frame that the click takes you to:

on(release) {
    fsCommand("exec", "flop.exe");
    gotoAndPlay("somewhere");
}

So now when the button is "right clicked," it executes a program called flop.exe that, guess what, flips the mouse controls back to their original state. And that's it.

I would include some VB or C++ code, but I think its outside the scope of this arena. If you or someone you know is halfway knowledgable at either of these languages, it is about 20 mins of work to write the two exe's. Good luck, hope this helps.


One final note. I am not liable for the use of this technique. So if it hoses you or your users systems, don't bitch at me. Use this at your own risk. Happy Flashing!

 

by: stef4sPosted on 2001-06-25 at 04:08:24ID: 6224206

I have done something similar in VB. I subclass the right-click event and do nothing with it (gets rid of the about menu). I will work on a solution for the rightclick though.

 

by: TimCaturaHouserPosted on 2002-04-20 at 17:54:42ID: 6957034

Good plan, and it leave the system reversed in the event
of a abnormal (abend in Netware terms) exit.

I got some cool custom programming from another pro...

Thanks all. Sorry this sat open...

 

by: TimCaturaHouserPosted on 2002-04-20 at 17:55:59ID: 6957035

A custom program was created. Thanks.

 

by: DanRollinsPosted on 2002-06-18 at 05:39:53ID: 7088280

Hi TimCaturaHouser,
You've requested to delete this question, but its status has remained as 'Pending Delete' because one or more comments have been added.  Normally, the only way to fully delete such a Question is to post a message to Community Support and ask for assistance.

EE is making a one-time database sweep to purge the Pending Delete Questions automatically.  During this sweep:

    TimCaturaHouser -- To allow the deletion to proceed:  Do nothing.
    EXPERTS -- Please DON'T POST a comment except to contest this deletion.

In the future, please refer to http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp#8 for instruction on deleting questions.

DanRollins -- EE database cleanup volunteer

 

by: stef4sPosted on 2002-06-19 at 03:08:16ID: 7092218

TimCaturaHouser: I believe that you got the idea for the custom program from this thread. Please award the points to someone.

 

by: TimCaturaHouserPosted on 2002-06-19 at 09:53:51ID: 7093234

It was a wierd one, and you did start conversation (too bad it wasn't continued here). A custom C++ piece sorta did the trick. I'm not throughly happy because if the program exits without following the code to the end, the mouse buttons are reversed. In the end, the project was dropped as unworkable. I'll revisit this in 2003 with the new tools available under .Net   Thanks!

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...