ActionScript 3 Context Menu Per Sprite?
Posted
by TheDarkIn1978
on Stack Overflow
See other posts from Stack Overflow
or by TheDarkIn1978
Published on 2010-06-12T08:19:01Z
Indexed on
2010/06/12
8:22 UTC
Read the original article
Hit count: 212
actionscript-3
|contextmenu
is it not possible to have different context menus for different sprites on the stage?
i've tried adding a custom context menu to a sprite but it's applied to the entire stage:
mySprite.contextMenu = myMenu;
then after reading the documentation where it states:
You can attach a ContextMenu object to a specific button, movie clip, or text field object, or to an entire movie level. You use the menu property of the Button, MovieClip, or TextField class to do this.
ok, so i though i had to write it like:
mySprite.menu.contextMenu = myMenu;
only to be greeted with a nice migration issue stating that menu is legacy code and to use contextMenu instead. ??? um, thanks for the headsup, documentation.
this process would be entirely much more easier if i could extend the ContextMenu, but for some reason it's marked as "final" and can't be extended... i'm sure adobe's reasons for finalizing the context menu class are as good as their reasons for including misleading documentation.
thoughts?
© Stack Overflow or respective owner