Menu (Movieclip.menu Property) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

See also
,
_root property
_lockroot (MovieClip._lockroot property)
(MovieClip.attachMovie method)
onLoadInit (MovieClipLoader.onLoadInit event listener)

menu (MovieClip.menu property)

public menu : ContextMenu
Associates the specified ContextMenu object with the movie clip. The ContextMenu class lets
you modify the context menu that appears when the user right-clicks (Windows) or Control-
clicks (Macintosh) in Flash Player.
Availability: ActionScript 1.0; Flash Player 7
Example
The following example assigns the
The ContextMenu object contains a custom menu item labeled "View Image in Browser" that
has an associated function named
var menu_cm:ContextMenu = new ContextMenu();
menu_cm.customItems.push(new ContextMenuItem("View Image in Browser...",
viewImage));
this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
target_mc.menu = menu_cm;
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("photo1.jpg", image_mc);
function viewImage(target_mc:MovieClip, obj:Object) {
getURL(target_mc._url, "_blank");
}
When you right-click (Windows) or Control-click (Macintosh) the image at runtime, select
View Image in Browser from the context menu to open the image in a browser window.
See also
menu (Button.menu property)
(TextField.menu property)
898
ActionScript classes
,
loadMovie (MovieClip.loadMovie method)
ContextMenu object to the
menu_cm
:
viewImage()
,
,
ContextMenu
ContextMenuItem
,
attachMovie
,
movie clip.
image_mc
,
menu

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF