03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

See also<br />

onSelect (ContextMenu.onSelect h<strong>and</strong>ler)<br />

separatorBefore (ContextMenuItem.separatorBefore<br />

property)<br />

public separatorBefore : Boolean<br />

A Boolean value that indicates whether a separator bar should appear above the specified<br />

menu item. By default, this property is false.<br />

Note: A separator bar always appears between any custom menu items <strong>and</strong> the built-in menu<br />

items.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7<br />

Example<br />

This example creates three menu items, labeled Open, Save, <strong>and</strong> Print. A separator bar divides<br />

the Save <strong>and</strong> Print items. The menu items are then added to the ContextMenu object's<br />

customItems array. Finally, the menu is attached to the current Timeline of the SWF file.<br />

var my_cm:ContextMenu = new ContextMenu();<br />

var open_cmi:ContextMenuItem = new ContextMenuItem("Open", itemH<strong>and</strong>ler);<br />

var save_cmi:ContextMenuItem = new ContextMenuItem("Save", itemH<strong>and</strong>ler);<br />

var print_cmi:ContextMenuItem = new ContextMenuItem("Print", itemH<strong>and</strong>ler);<br />

print_cmi.separatorBefore = true;<br />

my_cm.customItems.push(open_cmi, save_cmi, print_cmi);<br />

function itemH<strong>and</strong>ler(obj, menuItem) {<br />

trace("You chose: " + menuItem.caption);<br />

};<br />

this.menu = my_cm;<br />

See also<br />

onSelect (ContextMenu.onSelect h<strong>and</strong>ler)<br />

visible (ContextMenuItem.visible property)<br />

public visible : Boolean<br />

A Boolean value that indicates whether the specified menu item is visible when the Flash<br />

Player context menu is displayed. By default, this property is true.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 7<br />

ContextMenuItem 461

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!