ContextMenu and JFXPanel

I've tried to add a context menu to the ListView and meet a problem. When my class extends Application everything is Ok, but when I use JFXPanel I don't see context menu. Is it common bug, or only my own? Is there any workaround? Here is my 2 classes
import javafx.application.Application;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.stage.Stage;
public class Main3 extends Application { 
  public static void main(String[] args) {
    Application.launch(args);
  public void start(Stage stage) {
    stage.setTitle("Sample");
    stage.setWidth(300);
    stage.setHeight(200);
    Scene scene = createScene();
    stage.setScene(scene);
    stage.show();
  private Scene createScene() {
    ListView<String> listView = new ListView<String>();
    listView.getItems().addAll("1", "2", "3");
    ContextMenu menu = new ContextMenu();
    MenuItem item = new MenuItem("Click me");
    item.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        System.out.println("clicked");
    menu.getItems().add(item);
    listView.setContextMenu(menu);
    Scene scene = new Scene(listView);
    return scene;
} And with JFXPanel
import java.awt.BorderLayout;
import javax.swing.*;
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
public class Main2 {
  public static void main(String[] args) {   
    JPanel panel = new JPanel(new BorderLayout());
    final JFXPanel fxPanel = new JFXPanel();
    panel.add(fxPanel, BorderLayout.CENTER);
    Platform.runLater(new Runnable() {
      public void run() {
        Scene scene = createScene();
        fxPanel.setScene(scene);
    JDialog dialog = new JDialog((java.awt.Frame)null, "Swing");
    dialog.setContentPane(panel);   
    dialog.setSize(300, 200);
    dialog.setLocation(10, 10);
    dialog.setVisible(true);
  public static Scene createScene() {
    ListView<String> listView = new ListView<String>();
    listView.getItems().addAll("1", "2", "3");
    ContextMenu menu = new ContextMenu();
    MenuItem item = new MenuItem("Click me");
    item.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        System.out.println("clicked");
    menu.getItems().add(item);
    listView.setContextMenu(menu);
    Scene scene = new Scene(listView);
    return scene;
}

Well, JavaFX 2.2 beta solved this problem

Similar Messages

  • Will Scene Builder 2 support SwingNode and JFXPanel?

    We have a large swing app that we're migrating to JavaFX over time. I want to use FXML and SceneBuilder for all new UI design and am wondering if SB 2.0 will support SwingNode and JFXPanel? If so, what level of support? Will I be able to set all the properties/handles in the SwingNode and JFXPanel but nothing inside the embedded node from the other UI type? This is all that I was hoping for.
    We're going be mixing Swing and FX longer term so we'd need this support (along with the custom control support in SB 2.0) to effectively use it.
    Thanks,
    -Darryl

    Sorry for the late reply, Darryl.
    Yes, SB2 will support SwingNode.
    You will be able to drop a SwingNode in any container that accepts a Node:
    - In the Content panel, you will be able to select and move the SwingNode.
    You will not be able to resize it (because a SwingNode has no sizing properties).
    - In the Hierarchy, SwingNode will be a leaf node (SB won't allow you to build
      a Swing UI inside your SwingNode)
    - In the Inspector, SwingNode will be inspectable like any other Node  :
      however SwingNode.content property will not be exposed ; this property will
      have to be manipulated programmatically by your application.
    Eric

  • Desk top pics and screensavers on Macbook

    Sorry but I am finding this whole forum thing incredibly difficult to make work and am absolutely technically illiterate. All the jargon leaves me only more confused. Don't even know if am posting this on right page since can't find anywhere else to go.
    My question
    Want to change pic on desktop but don't like alternatives offered on the desktop menu but DO like some of pics on screensaver menu. Is there any way one can move say the forest images to the desktop section and then use them as desktop image? Don't want to pay for any and feel Apple might care to provide more free pics.
    Can anyone answer in very very simple step by step terms I might just understand?

    Yes, then the screensaver from the System contain normal images.
    1. Open the path: System > Library > Screen Savers.
    2. Select one, open the ContextMenu and choose Show Package.
    3. Open the folder Contents > Resources.
    5. Then open the Library of the root level, open the folder Desktop Pictures and copy the images into.
    6. Open the the System Preference > Desktop & Screensaver and select the new image.

  • Using contextMenu

    hello guys!
    well, i was trying to make a contextMenu. and everything was
    working fine till i had more than 15 items (contextMenu doesnt
    support) in the menu
    since i needed to build my menu each time i click it, i used
    the onSelect function to build it, brolem was the same, once i push
    it inside, i could not remove him.
    Right now, the only solution i can see is, when i invoke my
    function i need to clear all the contextmenu content and build it
    again without having to make a new contextmenu (tried that but was
    only working on the 2x right click)
    its there a way to clean all my contextMenu array and make
    him again?
    i was to be possble to, when i click, look for variables and
    contruct my menu.

    Hi,
    Here is some documentation about trees.
    http://livedocs.adobe.com/flex/3/html/help.html?content=dpcontrols_8.html
    Trees can use arrayCollections, you can add and delete item from an array, right?
    Here is sample code to show you how to use mouse right click:
    http://cookbooks.adobe.com/post_Select_List_item_with_mouse_right_click-11606.html
    I hope this help you to start.
    Best,

  • Get Current Selected Cell Value in an af:table

    Using JDeveloper 11.1.1.3.0
    I currently have a requirement where i need to call a server method and pass the value of the current selected Cell value in my af:table.
    The reason why i can't just make use of the currentSelectedRow is because i have a set of Columns (NumericValue1,NumericValue12,...NumericValue1n) and my server method can't really tell which cell i picked.
    So far, what i did is that i utilized F. Nimphius's article about using contextMenu and passing a clientAttribute.
    Re: How to pass parameter to inline popup when mouse over
    I'm hoping to do the same thing but without raising a popup on right click. So basically, i'm hoping to select an outputText in the table and this value will be stored in a pageFlowScopeBean.
    Has anybody encountered something similar?
    Thanks.

    Hi Barbara,
    You're aproach sounds intersting.
    So you mean to say, i'll create a component which has a bindings to my pageDefinition which needs to have it's clientComponent attribute set to true i believe so that my javascript can find this component.
    Then, i'll write a javascript that handles the focus event which then stores the clientAttribute value and stores that in the hidden component mentioned earlier. I'm guessing that once i set the newValue to the hidden component, it should be posted to the pageDef bindings upon hitting server side calls.
    I'll try this out and give an update on it.

  • Right Click Arrange  at runtime in code? in Flash CS4 (AS3)

    Hi,
    I was wondering if and how I can arrange movie clips in AS3 code. I want it to have the same effect as "Right Click > Arrange > Bring To Front" in the project, only during runtime and through code.
    Thank you for help and advice!

    What you can do if you want right click is create a new ContextMenu  and ContextMenuItem. You'll have to add a mouse click listener to each  of your stage items though so you can track the last one clicked;
    import flash.events.ContextMenuEvent;
    import flash.ui.ContextMenu;
    import flash.ui.ContextMenuItem;
    var  lastItem:MovieClip;
    var i:int;
    for(i =  0; i < stage.numChildren; ++i){
          stage.getChildAt(i).addEventListener(MouseEvent.MOUSE_DOWN,  itemClicked);
    function  itemClicked(e:MouseEvent):void
         lastItem =  e.currentTarget as MovieClip;
    var  rightClickMenu:ContextMenu = new ContextMenu();
    rightClickMenu.hideBuiltInItems();
    rightClickMenu.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,  rightClickMenuClicked);
    var bringToFront:ContextMenuItem =  new ContextMenuItem("Bring To Front");
    rightClickMenu.customItems = [bringToFront];
    stage.showDefaultContextMenu  = false;
    stage.contextMenu = rightClickMenu;
    function  rightClickMenuClicked(e:ContextMenuEvent):void
          switch (e.mouseTarget.label)
              case "Bring To  Front":
                   if(lastItem != null){
                         lastItem.parent.addChild(lastItem);           
               break;
    NOTE: You do not need to  first remove the child to add it again. By adding an existing child  you're simply resetting it to the top depth.

  • Add Custom Right click menu on editable AdvancedDataGrid

    Hi,
    I have an AdvancedDataGrid whose editable property is set to true and selectionmode is multipleCells.
    Is it possible to display custom right click menu when i right click on any cell? Am getting only the
    default menu items (Cut, Copy, Paste, Select All). Am using ContextMenu and ContextMenuItem class
    for creating the custom right click menu. The same code is working in Flex and not in AIR. Do we have
    to use NativeMenu in Adobe AIR? Please help. Attaching sample of my code.
    <mx:Script>
    <![CDATA[
    [Bindable] 
    private var cMenu:ContextMenu; 
    public function createContextMenu():void {
              cMenu =
    new ContextMenu();     cMenu.hideBuiltInItems();
         cMenu.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelect);
         var cMenuItemCopy:ContextMenuItem = new ContextMenuItem("Copy Data");     cMenuItemCopy.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItemSelect_Copy);
         var cMenuItemPaste:ContextMenuItem = new ContextMenuItem("Paste Data");     cMenuItemPaste.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItemSelect_Paste);
         cMenu.customItems.push(cMenuItemCopy);     cMenu.customItems.push(cMenuItemPaste);
    this.contextMenu = cMenu;    
    private  
    function contextMenu_menuSelect(event:ContextMenuEvent):void { }
    private function contextMenuItemSelect_Copy(event:ContextMenuEvent):void {
         copy(event);
     private function contextMenuItemSelect_Paste(event:ContextMenuEvent):void {
         paste(event);
    ]]>
    </mx:Script><mx:AdvancedDataGrid  width="100%" height="72%" id="dProvider" creationComplete="init()"
          editable="true" itemEditBeginning="checkIfAllowed(event)" itemEditEnd="onEditEnd(event)"
          selectionMode="multipleCells" itemRenderer="renderer.ColorForDashBoard" contextMenu="{cMenu}"/ >

    I have same issue too. Can any one help
    Thanks

  • WebView sizing issue

    Hi,
    I'm embedding a WebView through a JFXPanel in a existing Swing app and running into some issues regarding to sizing.
    My issue is that sometimes the height/width reported in JavaScript inside the WebView is 800*600, while most of the time it is reported to be equal to the dimensions of the WebView/Scene/JFXPanel. As the content I'm showing is a chart that renders itself to a size according to the dimensions of a parent DOM node, which is in this case the document.body, you can imagine that the results are wrong when the values reported in JavaScript for width and height are wrong.
    Ideally what I want is that the size of the body of the HTML document automatically follows the dimensions of the JFXPanel, meaning that is the JFXPanel gets resized, the dimensions of the scene/WebView follow suit. As this is not possible AFAIK, I've now setup a ComponentListener on the JFXPanel to update the dimensions of the WebView through the componentResized method of the ComponentListener. However, this still gives me the mixed results.
    I've setup a log of logging and I see that when the JavaScript layer reports the 800*600 dimensions, the dimensions of the WebView, Scene and JFXPanel are NOT reported as 800*600, but all report the actual size.
    My setup is as follows:
    - JFXPanel containing a Scene containing a WebView.
    - The scene is constructed without specifying a width/height
    - The JFXPanel is dimensioned by a special Swing layout manager
    - The WebView is loaded with custom HTML through loadContent() of the WebEngine
    - The body of the HTML document is sized 100%*100% through CSS
    - Dimensions in JavaScript are retrieved through document.body.getWidth/Height
    - In the custom HTML a chart is instantiated with the dimensions of the
    - Using Java 1.7 update 25 64bit on Windows with the bundled JavaFX
    Any thoughts appreciated.
    P.

    Please a correction i have seen that this error is produced on every scheduled report. The problem i am facing is that the campaign consolidated daily report is not imported in the specified folder.
    Help!

  • Right click in AS3

    Guys I've just changed for Flash CS3, and I tried using the
    code to disable right click as in AS2 but it outputted some errors.
    What code do you use in order to disable right click in flash cs3
    AS3? Thanks

    What you can do if you want right click is create a new ContextMenu  and ContextMenuItem. You'll have to add a mouse click listener to each  of your stage items though so you can track the last one clicked;
    import flash.events.ContextMenuEvent;
    import flash.ui.ContextMenu;
    import flash.ui.ContextMenuItem;
    var  lastItem:MovieClip;
    var i:int;
    for(i =  0; i < stage.numChildren; ++i){
          stage.getChildAt(i).addEventListener(MouseEvent.MOUSE_DOWN,  itemClicked);
    function  itemClicked(e:MouseEvent):void
         lastItem =  e.currentTarget as MovieClip;
    var  rightClickMenu:ContextMenu = new ContextMenu();
    rightClickMenu.hideBuiltInItems();
    rightClickMenu.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,  rightClickMenuClicked);
    var bringToFront:ContextMenuItem =  new ContextMenuItem("Bring To Front");
    rightClickMenu.customItems = [bringToFront];
    stage.showDefaultContextMenu  = false;
    stage.contextMenu = rightClickMenu;
    function  rightClickMenuClicked(e:ContextMenuEvent):void
          switch (e.mouseTarget.label)
              case "Bring To  Front":
                   if(lastItem != null){
                         lastItem.parent.addChild(lastItem);           
               break;
    NOTE: You do not need to  first remove the child to add it again. By adding an existing child  you're simply resetting it to the top depth.

  • Right click on datagrid question

    Hi guys
    I'm trying to get the columnIndex on a right click on a datagrid, so that I can use it when I select an item from my custom contextMenu.
    Currently...
    data_grid.addEventListener(ListEvent.ITEM_ROLL_OVER, dataGridRollOver);
    private function dataGridRollOver(event:ListEvent):void    {  lastRollOverRow = event.index;  lastRollOverColumn = event.columnIndex; }
    Then in my contextMenu function, I use lastRollOverRow and lastRollOverColumn
    It works fine if I right click, select a contextMenu option, then choose another row and repeat etc...
    However, say I right click, decide I've clicked on the wrong column, don't choose anything from the contextMenu, and then my next action is to right click on the correct column - the above event listener doesn't fire again (I presume because the contextMenu has focus), so my vars don't get updated.
    Is there a way to give focus back to the DG on a consecutive right click before re-displaying the contextMenu?
    I notice I don't need to set up an event listener to catch the right click for the datagrid's contextMenu. Is there something I can change so I can do something first before the contextMenu pops up?
    Cheers for your help.

    I'm a little confused mate. I thought that was what I already had set up (I forgot to mention that when the datagrid's RIGHT_CLICK function is triggered, I make sure the menu appears a few pixels left and up so that the mouse is over it), but are you saying that during creation, I need to apply a one-off event listener to the grid to initialize things as well as the one I already have that is listening to see if the user rolls off the entire grid:  rightClickMENU.addEventListener(MouseEvent.MOUSE_OUT, rightClickMenuRollOff); ?
    Re-reading my post, maybe I was a bit tired writing it!!!  Let me explain a little more clearly:
    - mainClass (where my datagrid is) calls and creates new instance of rightClickMENU, then calls a function to do this:
    addChild(rightClickMENU);
    rightClickMENU.visible = false;
    rightClickMENU.addEventListener(MouseEvent.MOUSE_OUT, rightClickMenuRollOff);
    (rightClickMENU class creates a container movieclip, then a bunch of rollover buttons, and addChilds each button to it's container - so the container is in the rightClickMENU class)
    - in mainClass, put this listener on datagrid: rightClickMENU.addEventListener(MouseEvent.MOUSE_OUT, rightClickMenuRollOff);
    - in mainClass, my roll on /roll off functions do this:
    private function showRightClickMenu(event:MouseEvent):void
                var X = event.localX * 4.3015;//default DG width is 272.  So set up correct right click position ratio 1170/272 = 4.3015.
                var Y = event.localY * 2.2513;//default DG height is 191    
                //with my datagrid pos offset, the coords below end up showing the menu with the mouse about three pixels in from the top corner:
                rightClickMENU.x = X+13; rightClickMENU.y = Y+75;
                rightClickMENU.visible = true;
    private function rightClickMenuRollOff(event:MouseEvent):void //menu roll out
                rightClickMENU.visible = false;
    Can you please explain a little more what you mean in your post?

  • ADF treetable - Identify RightClick of selected vs unselected row

    Hello,
    We have a tree table with client and server Listeners set for selection and contextMenu types
    TreeTable is set to use contextMenu select = true
    Use Case 1
    User selects a Row
    selection listener fires
    Use Case 2
    User right clicks a selected Row
    contextMenu listener fires
    Use Case 3
    User right clicks a unselected Row
    selection listener fires
    contextMenu listener fires
    We need to differentiate between Use Case 1 and 3
    For Use Case 3, our requirement is to suppress/ignore the firing of selection Listener
    A possible approach could be to read the event source (tree table) and check if any immediate oncoming event is of type contextMenu, and then bypass the code inside selectionListener
    Any pointers ?

    Couple of points
    1. The documentation mentions the use of getRowKey() which is returning null
    The highlighted row key is established as a currency in the table when the action for context menu item is executed. The currency in the table can be retrieved by calling "table.getRowKey()"
    2. As posted, we are interested to know if the row was right clicked and then disregard the selection Listener. The server listener for context menu select is fired after the selection listener. So we need help
    Any pointers ?
    Thanks

  • ADF: Passing parameters from one page to another using setPropertyListener

    Hi,
    I'm trying to find a simple way to pass a parameter from one page to another.
    On the first page I have a table, the second page is a history page, showing the change history of rows from the table on the first page.
    In the table on the first page there's a unique column (an order number), the value of which is never changed for a given row.
    What I would like is to be able to pass the order number from the currently selected row of the first page on to the history page, making the history page show only the history for the given order number.
    Using the task-flow for the history page, I've defined an input parameter (an order number), defined a criteria and so on. I've tested the functionality of this in the Application Module, and it seems to work.
    My problem is passing the order number from the first page to the second.
    I've created a Managed Bean, with a variable for the current order number, including accessors. On the table on the first page, I've created a contextMenu, and added an Item called "Show history" with an action that navigated from the first to the second page (a control flow I've defined in adfc-config). I've included a setPropertyListener in the "Show history" item. I've set the "From" property of the setPropertyListener to "#{row.ordernumber.attributeValue}" and the "To" property to point at the order variable in the Managed Bean. Finally, I created a new page for the history, dragged the history task flow onto this page as a region, using the Managed Bean order variable as input parameter.
    The result is this: When I bring up the context menu from a row in the table on the first page and select "Show history", I get this error: "The class 'java.lang.String' does not have the property 'attributeValue'."
    That's a bit puzzling to me, seeing as I used the Expression Builder to fill out the "From" property. I've tried using "inputValue" instead of "attributeValue", but that simply changes the error message to: "The class 'java.lang.String' does not have the property 'inputValue'."
    What am I doing wrong?
    Regards,
    Andreas

    Hi Timo and Puthanampatti,
    I actually tried something similar to what you have suggested before starting this thread, but still got an error. What I hadn't spent a lot of time investigating initially was that it gave a DIFFERENT error. But after reading Timo's suggestion, I went back to this other error and found out that it was connected to my Managed Bean. For some reason, I had made the mistake of giving the bean the same name (in adfc-config) as the actual java class. And this leads to a circular reference error (that I would only get to see when I didn't get the java.lang.String error first).
    Having fixed this, I can successfully pass my parameter from one page to another (with the "From" property of the setPropertyListener set to "#{row.ordernumber}").
    Thanks for your time,
    Andreas

  • WebView inside JFXPanel: No drag and drop events received

    Hi,
    I'd like to manage Dnd between apps and a Swing application with a JFXPanel which embeds a WebView component.
    Currently, all drops are forbidden on top of the WebView, and I'd like to find a way for the WebView to accept transferable object such as URL...
    Moreover, code like this does not display anything in console. If I create a native JFX application (without JFXPanel Swing layer) the drag events occur.
                    webView.setOnDragDetected(new EventHandler<MouseEvent>() {
                   public void handle(MouseEvent event) {
                        System.err.println(event.toString());
              webView.setOnDragEntered(new EventHandler<DragEvent>() {
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());
              webView.setOnDragOver(new EventHandler<DragEvent>() {
                   @Override
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());                    
              webView.setOnDragDropped(new EventHandler<DragEvent>() {
                   @Override
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());                    
              });I guess JFXPanel catches events, or I missed something...
    If anyone could help, thanks in advance!

    Hi,
    For people who can help, here is the entire code to reproduce the problem.
    JFXPanel seems to consume the DND event, and the JFX WebView component does not receive anything.
    Thanks a lot.
    import java.awt.Dimension;
    import javafx.application.Platform;
    import javafx.embed.swing.JFXPanel;
    import javafx.event.EventHandler;
    import javafx.scene.Scene;
    import javafx.scene.input.DragEvent;
    import javafx.scene.input.Dragboard;
    import javafx.scene.input.TransferMode;
    import javafx.scene.paint.Color;
    import javafx.scene.web.WebView;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    public class WebViewInJFXPanel {
         private void initAndShowGUI() {
              // This method is invoked on Swing thread
              JFrame frame = new JFrame("WebView in JFXPanel");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              final JFXPanel fxPanel = new JFXPanel();
              fxPanel.setOpaque(false);
              fxPanel.setPreferredSize(new Dimension(800,600));
              frame.add(fxPanel);
              frame.pack();
              frame.setVisible(true);
              // Init JFX
              Platform.runLater(new Runnable() {
                   @Override
                   public void run() {
                        initFX(fxPanel);
         private void initFX(JFXPanel fxPanel) {
              // This method is invoked on JavaFX thread
              WebView webView = new WebView();
              webView.getEngine().load("http://javafx.com");
              // The following triggers are never invoked once in a JFXPanel
              webView.setOnDragEntered(new EventHandler<DragEvent>() {
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());
              webView.setOnDragOver(new EventHandler<DragEvent>() {
                   @Override
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());
                        Dragboard db = event.getDragboard();
                        if (db.hasString()) {
                             event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
                        event.consume();
              webView.setOnDragDropped(new EventHandler<DragEvent>() {
                   @Override
                   public void handle(DragEvent event) {
                        System.err.println(event.toString());          
                        Dragboard db = event.getDragboard();
                        boolean success = false;
                        if (db.hasString()) {
                             System.out.println("Dropped: " + db.getString());
                             success = true;
                        event.setDropCompleted(success);
                        event.consume();
              Scene scene = new Scene(webView, 800, 650, Color.BLACK);
              scene.setFill(Color.BLACK);
              fxPanel.setScene(scene);
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   @Override
                   public void run() {
                        new WebViewInJFXPanel().initAndShowGUI();
    }

  • Problems with Mozilla and ContextMenu

    Hello Friends,
    I am working in Flash cs3. I am having problems with mozilla related to contextMenu.
    Using contextMenu, i removed all BuiltInItems. Its working fine in IE.
    when i am viewing the same html file in mozilla, "Show Redraw Regions" option is still visible when i am right clicking on browser. In IE, its fine.
    How to remove this option in Mozilla.
    Any solutions would be appreciated.
    Regards,
    Rajesh

    Thanks for your reply.
    By the way what is debug player ?? from where did i get this player ? and how to install this debug player in mozilla. can you pls provide me the link to install the debug player of mozilla firefox.
    waiting for your reply.
    Rajesh

  • 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()">
    <mx:Script>
    <![CDATA[
    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;
    contextMenu.hideBuiltInItems();
    var menuItem:ContextMenuItem = new ContextMenuItem("test");
    menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
    eventHandler);
    contextMenu.customItems.push(menuItem);
    video.contextMenu = contextMenu;
    ]]>
    </mx:Script>
    <mx:VideoDisplay id="video" source="myVideo.flv"
    width="300" height="300"/>
    </mx:Application>
    Can someone help me to solve the problem ?
    Thanks

    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()">
    <mx:Script>
    <![CDATA[
    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;
    contextMenu.hideBuiltInItems();
    var menuItem:ContextMenuItem = new ContextMenuItem("test");
    menuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
    eventHandler);
    contextMenu.customItems.push(menuItem);
    video.contextMenu = contextMenu;
    ]]>
    </mx:Script>
    <mx:VideoDisplay id="video" source="myVideo.flv"
    width="300" height="300"/>
    </mx:Application>
    Can someone help me to solve the problem ?
    Thanks

Maybe you are looking for

  • Problem about D-link card installation on Solaris 8 intel

    hello, I don't know how to install my ethernet card on the Solaris 8 intel. It's a D-link DFE-530TX model on PCI bus. Could you send my the methode to install it. Thank you very much.

  • Unable to load Query Builder component

    Hello, When I try to refresh a report in Crystal Reports 10, it displays this error message: "Failed to load database information." "Details: Unable to load Query Builder component." Then, when I try to register querybuilder.dll, RegSvr32 gives this

  • Duplicate files appearing in Windows Photo Gallery under Vista Home Basic.

    I am suffering a bout of duplications in my Windows Photo Gallery under Vista. I am getting duplicates, triplicates and quadruple versions of the original file. Despite turning off all Autoplay media types to 'No Action', I get random duplicates when

  • Maxdb 7.7.4 wont start ERR_WRONGDBSTATE Operational State UNKNOWN

    Hi, We are running maxdb 7.7.4 on a linux suse 10 environment. The system was shutdown the other week and we cannot get it to restart When we try and restart we get the following in the dbm.prt client connection was established at 2010-11-03 01:13:04

  • IDML file saved in CS6 does not open in CS5

    Hi there, Trying to figure out this problem. A file created in InDesign CS6 we saved it as a idml file to be opened from cs5. When cs5 tries to open it it complains about plugins are missing. Has anybody run into this problem?