Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-28-2007, 12:04 PM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default ricght mouse context menu

I want to let users right click on a movieclip and have a context menu that lets the users select actions for that movieclip (like copy, change color, lookup value,...)

The context menu should be different according to which movieclip is clicked

Is it possible with swfkit to build such a control?
Reply With Quote
  #2 (permalink)  
Old 12-01-2007, 07:05 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: ricght mouse context menu

Code:
import SWFKit.*;

var fp = new FlashPlayer;
fp.setEventHandler("onContextMenu", onContextMenu);
fp.Release();

function onContextMenu() {
	if (mc1.hitTest(_xmouse, _ymouse, false)) {
		Dialogs.msgBox("hit!");
	}
}
where mc1 is the name of your movieclip. The above code just pops up a message box, you can display a menu instead.
Reply With Quote
  #3 (permalink)  
Old 12-15-2007, 07:22 AM
Junior Member
 
Join Date: Jun 2005
Posts: 22
Default Re: ricght mouse context menu

Hi,

if I have more than one MC generated by attachmovie method , how can I assign a context menu for each MC ?

Reply With Quote
  #4 (permalink)  
Old 12-24-2007, 03:32 AM
Junior Member
 
Join Date: Jun 2005
Posts: 22
Default Re: ricght mouse context menu

anybody can help ?
Reply With Quote
  #5 (permalink)  
Old 12-25-2007, 07:31 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: ricght mouse context menu

Sure, the above code should also work. You just need to check in which movie clip the mouse has been right clicked by calling the hitTest method, and then display a menu for it.
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 04:39 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.