-
Notifications
You must be signed in to change notification settings - Fork 4
/
RightClickMenu.as
38 lines (31 loc) · 1.04 KB
/
RightClickMenu.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// ActionScript file
package
{
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;
import flash.ui.ContextMenuBuiltInItems;
import flash.display.Sprite;
import flash.text.TextField;
public class RightClickMenu extends Sprite
{
public var triCloudContextMenu:ContextMenu;
public function RightClickMenu(appName:String)
{
triCloudContextMenu = new ContextMenu();
removeDefaultItems();
addCustomMenuItems(appName);
}
private function removeDefaultItems():void
{
triCloudContextMenu.hideBuiltInItems();
var defaultItems:ContextMenuBuiltInItems = triCloudContextMenu.builtInItems;
defaultItems.print = false;
}
private function addCustomMenuItems(appName:String):void
{
var item:ContextMenuItem = new ContextMenuItem(appName);
triCloudContextMenu.customItems.push(item);
// TODO: Add icon!
}
}
}