|
|||
|
Hi! I am a newbie to SWFkit.
SWFkit can customize right-click menu(context menu), below is an example: FlashPlayer.onContextMenu = function () { var menu = new Menu; menu.createPopupMenu(); menu.appendItem("id0", "item 0"); menu.appendItem("id1", "item 1"); menu.appendItem(); menu.appendItem("id2", "item 2"); menu.appendItem("id3", "item 3"); var id = menu.show(); if (id == "id0") Dialogs.msgBox("item0 clicked"); else if (id == "id1") Dialogs.msgBox("item1 clicked"); else if (id == "id2") Dialogs.msgBox("item2 clicked"); else if (id == "id3") Dialogs.msgBox("item3 clicked"); } It works but I need sub menu on rollover, say on item 3. How to do that? When my mouse rollover on the context menu, the pointer(arrow) disappeared. How to make it visible again? Thanks at advance. |
|
|||
|
Code:
FlashPlayer.onContextMenu = function ()
{
var menu = new Menu;
menu.createPopupMenu();
menu.appendItem("id0", "item 0");
menu.appendItem("id1", "item 1");
menu.appendItem();
menu.appendItem("id2", "item 2");
menu.appendItem("id3", "item 3");
// creat the sub menu
var sub = new Menu;
sub.createPopupMenu();
sub.appendItem("subid0", "sub item 0");
sub.appendItem("subid1", "sub item 1");
sub.appendItem();
sub.appendItem("subid2", "sub item 3");
menu.appendItem(sub, "item 4");
var id = menu.show();
if (id == "id0") Dialogs.msgBox("item0 clicked");
else if (id == "id1") Dialogs.msgBox("item1 clicked");
else if (id == "id2") Dialogs.msgBox("item2 clicked");
else if (id == "id3") Dialogs.msgBox("item3 clicked");
else if (id == "subid0") Dialogs.msgBox("sub item0 clicked");
else if (id == "subid1") Dialogs.msgBox("sub item1 clicked");
else if (id == "subid2") Dialogs.msgBox("sub item2 clicked");
else if (id == "subid3") Dialogs.msgBox("sub item3 clicked");
}
|
|
|||
|
I have problems on the customized context menu.
My app is a desktop toy. When the context menu is popup and the toy is moving across the screen (act), the app will be suspended occasionally. How to avoid this? How to make a script that closes the context menu when the toy is moving? Thank you! |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|