From the official Macromedia documentation:
The ContextMenu class provides runtime control over the items in the Flash Player context menu, which appears when a user right-clicks (Windows) or Control-clicks (Macintosh) on Flash Player. You can use the methods and properties of the ContextMenu class to add custom menu items, control the display of the built-in context menu items (for example, Zoom In and Print), or create copies of menus.
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 classes to do this.
Having read the official Macromedia
definition of this cool new feature of Flash MX2004, lets
see how you can use this.
[ right click on the three graphic, text, etc. ]
First, we get rid of (most of) the normal menu items:
If you check out the properties and methods for ContextMenu in the help panel, youll see that we got:
customItems (an array)
hideBuiltInItems (we just used that above..)
And for the menu items themselves, we can use:
ContextMenuItem.caption
ContextMenuItem.copy
ContextMenuItem.enabled
ContextMenuItem.onSelect
ContextMenuItem. separatorBefore
ContextMenuItem.visible
The names being pretty much self-explanatory!
Now, lets see how we use these features to build our own menu: (all script and a few clips)
Select frame 1 and open the
ActionScript panel.
Here, Im going to run you through just one of the 5 menus you can see in the example fla/swf above. Theres one on _root, one on each clip, one on the button, and you also get new options on selectable textfields and urls as you can see.
Thats it, quite simple, no?
|
Please look at the code in the fla, check the comments, and then get imaginative and make your own menus; if you come up with something cool, let us know!! ;)
Also, if you have any questions or comments, feel free to post them in the appropriate forum on the kirupaForum.
| Cheers, | |
|
|
Eyezberg flasheyez.com |
Just a final word before we wrap up. What you've seen here is freshly baked content without added preservatives, artificial intelligence, ads, and algorithm-driven doodads. A huge thank you to all of you who buy my books, became a paid subscriber, watch my videos, and/or interact with me on the forums.
Your support keeps this site going! 😇

:: Copyright KIRUPA 2026 //--