| Package | flash.ui |
| Class | public final class ContextMenuBuiltInItems |
| Inheritance | ContextMenuBuiltInItems Object |
ContextMenu.hideBuiltInItems() method.
View the examples.
See also
| ContextMenu.hideBuiltInItems() |
| Property | Defined by | ||
|---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance.
| Object | |
| forwardAndBack : Boolean = true
The Forward and Back menu items let the user move forward or backward one frame in a SWF file at runtime (does not
appear for a single-frame SWF file).
| ContextMenuBuiltInItems | ||
| loop : Boolean = true
The Loop menu item lets the user set a SWF file to start over automatically when it reaches the final
frame (does not appear for a single-frame SWF file).
| ContextMenuBuiltInItems | ||
| play : Boolean = true
The Play menu item lets the user start a paused SWF file(does not appear for a single-frame SWF file).
| ContextMenuBuiltInItems | ||
| print : Boolean = true
The Print menu item lets the user send the displayed frame image to a printer.
| ContextMenuBuiltInItems | ||
![]() | prototype : Object
[static]
A reference to the prototype object of a class or function object.
| Object | |
| quality : Boolean = true
The Quality menu item lets the user set the resolution of the SWF file at runtime.
| ContextMenuBuiltInItems | ||
| rewind : Boolean = true
The Rewind menu item lets the user set a SWF file to play from the first frame when selected, at any time (does not
appear for a single-frame SWF file).
| ContextMenuBuiltInItems | ||
| save : Boolean = true
The Save menu item lets users with Shockmachine installed save a SWF file.
| ContextMenuBuiltInItems | ||
| zoom : Boolean = true
The Zoom menu item lets the user zoom in and out on a SWF file at runtime.
| ContextMenuBuiltInItems | ||
| Function | Defined by | ||
|---|---|---|---|
|
Creates a new ContextMenuBuiltInItems object so that you can set the properties for Flash Player to display or hide each menu item.
| ContextMenuBuiltInItems | ||
![]() |
Indicates whether an object has a specified property defined.
| Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter.
| Object | |
![]() |
Indicates whether the specified property exists and is enumerable.
| Object | |
![]() |
Sets the availability of a dynamic property for loop operations.
| Object | |
![]() |
Returns the string representation of the specified object.
| Object | |
![]() |
Returns the primitive value of the specified object.
| Object | |
public var forwardAndBack:Boolean = true
public var loop:Boolean = true
public var play:Boolean = true
public var print:Boolean = true
public var quality:Boolean = true
public var rewind:Boolean = true
public var save:Boolean = true
public var zoom:Boolean = true
public function ContextMenuBuiltInItems()
ContextMenuBuiltInItemsExample
to remove the normal right-click menu items from the stage and add a new menu item. This is
accomplished using the following steps:
myContextMenu is declared and then assigned to a new ContextMenu
object.removeDefaultItems() is called, which removes all built-in right-click
menu items except print.addCustomMenuItems() is called, which places an item called
Hello World menu selection into the customItems Array using the
push() method of Array.Hello World right-click menu item is then added to the stage's right-click
menu item list.addChild() via createLabel().
package {
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;
import flash.display.Sprite;
import flash.text.TextField;
public class ContextMenuBuiltInItemsExample extends Sprite {
private var myContextMenu:ContextMenu;
public function ContextMenuBuiltInItemsExample() {
myContextMenu = new ContextMenu();
removeDefaultItems();
addCustomMenuItems();
this.contextMenu = myContextMenu;
addChild(createLabel());
}
private function removeDefaultItems():void {
myContextMenu.hideBuiltInItems();
var defaultItems:ContextMenuBuiltInItems = myContextMenu.builtInItems;
defaultItems.print = true;
}
private function addCustomMenuItems():void {
var item:ContextMenuItem = new ContextMenuItem("Hello World");
myContextMenu.customItems.push(item);
}
private function createLabel():TextField {
var txtField:TextField = new TextField();
txtField.text = "Right Click";
txtField.x = this.stage.stageWidth/2 - txtField.width/2;
txtField.y = this.stage.stageHeight/2 - txtField.height/2;
return txtField;
}
}
}
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/labs/flashauthoringpreview/flash/ui/ContextMenuBuiltInItems.html