Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-04-2005, 02:31 AM
Junior Member
 
Join Date: Feb 2005
Posts: 3
Default Context menu with sub menu

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.

Reply With Quote
  #2 (permalink)  
Old 02-04-2005, 07:08 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Context menu with sub menu

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");
}
Reply With Quote
  #3 (permalink)  
Old 02-04-2005, 08:45 AM
Junior Member
 
Join Date: Feb 2005
Posts: 3
Default Re:Context menu with sub menu

Thx! I'll try it.
Reply With Quote
  #4 (permalink)  
Old 02-06-2005, 04:37 AM
Junior Member
 
Join Date: Feb 2005
Posts: 3
Default Re:Context menu with sub menu

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!
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:42 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.