1 Reply Latest reply on Feb 2, 2008 8:18 AM by lef2

    ContextMenu error in Flash Player 9

    utwesty
      I build basic software simulations (Office products, Graphic Design products, etc.) that often require a custom context menu. The method we use requires two menus to be pushed; one that hides the built-in items and one that contains the custom items. The custom menu is attached to a button instance with only a hit state using:

      var rClickMenu1_cm:ContextMenu = new ContextMenu();
      rClickMenu1_cm.hideBuiltInItems();
      var a = new ContextMenuItem("Update Driver...", wrong);
      var b = new ContextMenuItem("Disable", wrong);
      var c = new ContextMenuItem("Uninstall", wrong);
      var d = new ContextMenuItem("Scan for hardware changes", wrong, true);
      var e = new ContextMenuItem("Properties", correct1, true);
      rClickMenu1_cm.customItems.push(a, b, c, d, e);

      rClick1_btn.menu = rClickMenu1_cm;

      The second menu (to hide the built-in items) is in the first frame of an actions layer:

      var root_cm:ContextMenu = new ContextMenu();
      root_cm.hideBuiltInItems();
      _root.menu = root_cm;

      This has worked fine until my clients (and I) began running Flash Player 9 (most often after an update to IE 7). The custom items attached to the button no longer appear. I've found work-arounds (using a movie-clip instance, or using an button where the up/over/down are all set to alpha 0) but I'm curious if there is something in the code I could change, or any other fix for that matter--I'd really rather not go back and rebuild all the simulations I have built. I'm using Flash 8 Pro, publishing to Flash 7 AS 2.0.