Skip to main content
Participating Frequently
September 11, 2009
Question

How to include contextMenu for whole swf

  • September 11, 2009
  • 1 reply
  • 888 views

Hi everybody,

     Let me know How to include contextMenu for whole swf?

This topic has been closed for replies.

1 reply

Inspiring
September 13, 2009

Hi,

What code have you personally tried for this? Let us see how near or far you are from the goal post.

Kind Regards,

Boxing Boom

Participating Frequently
September 14, 2009

The following is the code I have tried

package{

     import flash.ui.ContextMenu;

     import flash.ui.ContextMenuItem;

     import flash.ui.ContextMenuBuiltInItems;
     import flash.events.ContextMenuEvent;

     public class index{

          public var myContextMenu:ContextMenu;

         

          public function index(){

                  myContextMenu = new ContextMenu();
                  myContextMenu.hideBuiltInItems();
                  myContextMenu.builtInItems.print = true;
                  this.ContextMenu = myContextMenu; //here I want to include the context menu for whole swf

          }

     }

}

Participant
November 9, 2011

I have a similar problem.

Stand alone my Sprites custom context menu always works. I can instantiate it using code, and nest it 'n' levels deep.

When I add it to my main application, a default context menu is shown.   The main application is very complex - as it's a design application similar to Balsamiq Mockups - so every individual widget has a stand alone test harness.   This has been working very well as a way of coping with the size and complexity of the main application. But the context menu thing just doesn't work in the main application, and from the documentation I've seen nothing that suggests I should have had any problems including else wher.

Please, please if anyone knows why in some scenarios a context menu stops working and the default context menu is shown instead then please share as I'm at the point of tearing my hair out on this....