nulldesign // lars gerckens » Custom right click menus in AIR

Custom right click menus in AIR

I was wondering, why DisplayObjects in AIR don’t support the MouseEvent.RIGHT_CLICK Event. The only way to implement a right-click-menu seemed to be a NativeMenu. But I needed only the event, not the ugly native-os-menu.

Here is the workaround: Just create a blank NativeMenu and listen for the display event.

var menu:NativeMenu = new NativeMenu();
menu.addEventListener(Event.DISPLAYING, onRightClick, false, 0, true);
someSprite.contextMenu = menu;

31. October 2007 | Posted in AIR, Actionscript

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Trackback this post  |  Subscribe to the comments via RSS Feed

About

  • nulldesign is the company and showcase site of freelance developer Lars Gerckens who is based in Hamburg, Germany. I'm available for freelance work with focus on Flex, Flash and AIR development. I like to create dynamic user interfaces, cutting edge web experiences and innovative ways to visualize data.

    This site showcases some of my personal work and projects as well as an selection of commercial projects.

    If you are interested in my work or you have any questions, don't hesitate to drop me a line:

  • Profiles: Xing | Linkedin
  • Mail: lars [at] nulldesign [dot] de

Categories

Search