0 Replies Latest reply on Apr 15, 2007 10:08 AM by GlopZ

    VideoDisplay and ContextMenu

      I wish to add a contextmenu item on a videodisplay component. When a video is playing and the menuitem selected, the contextmenuevent is not thrown. The following code is used :

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="creationComplete()">

      import mx.core.UIComponent;
      import mx.controls.Alert;

      private function eventHandler(event:ContextMenuEvent) : void
      mx.controls.Alert.show("event called");

      private function creationComplete() : void
      var contextMenu:ContextMenu = new ContextMenu;

      var menuItem:ContextMenuItem = new ContextMenuItem("test");
      menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, eventHandler);


      video.contextMenu = contextMenu;

      <mx:VideoDisplay id="video" source="myVideo.flv" width="300" height="300"/>


      Can someone help me to solve the problem ?