最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
flash cs3添加右键菜单
时间:2022-07-02 17:16:33 编辑:袖梨 来源:一聚教程网
flash cs3添加右键菜单
flash cs3的右键菜单 ContextMenu 对象附加到特定的按钮、影片剪辑或文本字段对象,也可以附加到整个影片级别。
所以这里设置一个背景影片剪辑st,然后添加如下代码:
var menuItem:ContextMenuItem = new ContextMenuItem("浪子设计");
menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,gotoAuthorPage);
var customContextMenu:ContextMenu = new ContextMenu();
customContextMenu.hideBuiltInItems();
customContextMenu.customItems.push(menuItem);
st.contextMenu = customContextMenu;
function gotoAuthorPage(event:ContextMenuEvent):void {
var targetURL:URLRequest = new URLRequest("http://www.flasc.cn/");
navigateToURL(targetURL);
}
所以这里设置一个背景影片剪辑st,然后添加如下代码:
var menuItem:ContextMenuItem = new ContextMenuItem("浪子设计");
menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,gotoAuthorPage);
var customContextMenu:ContextMenu = new ContextMenu();
customContextMenu.hideBuiltInItems();
customContextMenu.customItems.push(menuItem);
st.contextMenu = customContextMenu;
function gotoAuthorPage(event:ContextMenuEvent):void {
var targetURL:URLRequest = new URLRequest("http://www.flasc.cn/");
navigateToURL(targetURL);
}