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 (586) – 96.02 KB
Dependencies
None

June 25th, 2008 at 12:53 am
nice,
one feature might come in handy
it is the position you want your menu item to appear
June 25th, 2008 at 3:56 am
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.
June 25th, 2008 at 12:53 pm
Mr Steel,
I’m not sure if you can control that?
Jesse,
Hope it’s useful.
July 9th, 2008 at 11:18 am
[...] http://www.blog.noponies.com/archives/103 [...]
July 13th, 2008 at 4:53 am
Excellent!!!
July 22nd, 2008 at 1:36 am
Nice little utility class. I just used it in one of my flash websites.
July 26th, 2008 at 6:15 am
good work…it’s nice not having to reinvint at least one wheel as i migrate from as2 to as3!
July 30th, 2008 at 1:38 am
[...] http://www.blog.noponies.com/archives/103 [...]
August 15th, 2008 at 8:09 am
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!!!
August 15th, 2008 at 8:12 am
Got it! Thanks!
August 26th, 2008 at 2:01 pm
[...] – Contextual Menu Manager Class [...]
December 2nd, 2008 at 5:44 pm
[...] NpContextMenu Class [...]
January 7th, 2009 at 11:55 am
[...] 5、ActionScript 3 Contextual Menu Manager Class AS3关联菜单管理类 http://www.blog.noponies.com/archives/103 [...]
February 18th, 2009 at 7:34 am
[...] http://www.blog.noponies.com/archives/103 [...]
June 4th, 2009 at 7:57 am
[...] http://www.blog.noponies.com/archives/103 [...]