Tools/Flash

마우스 오른쪽 클릭 메뉴 변경하기 [AS3][Flash]

cwh 2018. 6. 22. 06:27

var my_menu:ContextMenu = new ContextMenu();

my_menu.hideBuiltInItems();


var m0 = new ContextMenuItem("처음으로");

var m1 = new ContextMenuItem("다음페이지");

var m2 = new ContextMenuItem("이전페이지");

my_menu.customItems.push(m0);

my_menu.customItems.push(m1);

my_menu.customItems.push(m2);

m0.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, m0_Click)

m1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, m1_Click)

m2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, m2_Click)


function m0_Click(e:ContextMenuEvent):void{

this.gotoAndStop(1);

}

function m1_Click(e:ContextMenuEvent):void{

this.nextFrame();

}

function m2_Click(e:ContextMenuEvent):void{

this.prevFrame();;

}


contextMenu = my_menu;