Flash Player 7.
my_mc.menu:ContextMenu=contextMenu
contextMenu A ContextMenu object.
Property; associates the specified ContextMenu object with the movie clip my_mc. The ContextMenu class lets you modify the context menu that appears when the user right-clicks (Windows) or Control-clicks (Macintosh) in Flash Player.
The following example assigns the ContextMenu object menu_cm to the movie clip image_mc. The ContextMenu object contains a custom menu item labeled "View Image in Browser..." that has an associated function named viewImage().
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 or Control-click the image at runtime, select View Image in Browser from the context menu to open the image in a browser window.
Button.menu, ContextMenu class, ContextMenuItem class, TextField.menu
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00001523.html