ActionScript 3 Contextual Menu Manager Class

The NpContextMenu Class is a fairly simple ActionScript 3 class for creating and interacting with Contextual Menus.

The class simply redispatches the ContextMenuEvent.MENU_ITEM_SELECT event to any parties interested in responding to menu events outside of the actual class. This allows for a little more flexibility with how events are handled and how the menu itself is set up. By using this approach the menu can be a a little more dynamic.

Class Features

  • Public Methods
  • addMenuItem() – add menu item at run time
  • removeMenuItem() – remove menu item at run time
  • hideMenuItem() – hide menu item at run time
  • showMenuItem()_ – show menu item at run time
  • + a few getters

View Example
http://www.noponies.com/dev/as3_context_menu/

Source Files
Context Menu Class Source File (708) - 96.02 KB

Dependencies
None

14 Neighs about “ActionScript 3 Contextual Menu Manager Class”



MrSteel Neighed:

nice,
one feature might come in handy
it is the position you want your menu item to appear

Jesse Freeman Neighed:

This class looks good. I have been using one called CMManager from http://orangeflash.eu/?p=12 but I look forward to giving your’s a try.

Dale Neighed:

Mr Steel,

I’m not sure if you can control that?

Jesse,

Hope it’s useful.

Dmitriy Neighed:

Excellent!!!

Robin Neighed:

Nice little utility class. I just used it in one of my flash websites.

vernon morris Neighed:

good work…it’s nice not having to reinvint at least one wheel as i migrate from as2 to as3!

ruben Neighed:

Hi! Nice class!

I can make it work if I put the code in the .fla, but if I try to put it in the document class, it doesn’t work, even though it doesn’t throw any error…

Could you help me? Thanks!!!

ruben Neighed:

Got it! Thanks!

AS3 | Actionscript 3 Classes « Flash Enabled Blog Neighed:

[...] – Contextual Menu Manager Class [...]

Flex Studio» Blog ?•¬?Àú?¶¬°¬£ AS3 ?•¬?‚Äú?®¬µ‚Äû?¶¬?¬ê Neighed:

[...] 5?£‚Ǩ¬ÅActionScript 3 Contextual Menu Manager Class?Ǭ†?Ǭ†?Ǭ†?Ǭ†?Ǭ†?Ǭ†?Ǭ†?Ǭ†AS3?•‚ͬ??®¬Å‚Äù?®¬è?ì?•¬ç‚Ä¢?߬Ƭ°?߬ê‚Ć?߬±¬ª http://www.blog.noponies.com/archives/103 [...]

Leave a neigh?