Professional Web Applications Themes

Popup menu on popup window - Macromedia Flex General Discussion

Hi, I want to create a popup menu when a button on a popup window is clicked. I have this in my popup window: myMenu = mx.controls.Menu.createMenu(); this.myMenu.show(100, 200); The menu shows up on parent's window instead, any ideas why? Thanks, P...

  1. #1

    Default Popup menu on popup window

    Hi,

    I want to create a popup menu when a button on a popup window is clicked. I
    have this in my popup window:

    myMenu = mx.controls.Menu.createMenu();
    this.myMenu.show(100, 200);

    The menu shows up on parent's window instead, any ideas why?

    Thanks,
    P

    Peepio Guest

  2. #2

    Default Re: Popup menu on popup window

    How about trying the following, basically changing the createMenu constructor
    to receive the parent UIObject. I havent tried this code but it may help.

    Andrew
    [url]www.flexdaddy.info[/url]



    import mx.controls.Menu;

    myMenu = Menu.createMenu( this );
    myMenu.x = 100;
    myMenu.y = 200;
    myMenu.show();

    Spaulds Guest

  3. #3

    Default Re: Popup menu on popup window

    I tried it, it doesn't work. I also tried other ways s.a. this.parent.popupWindowName, etc. The only way I can get around is using modalless popup, but I need it to be modal.

    Thanks.
    Peepio Guest

  4. #4

    Default Re: Popup menu on popup window

    This is from flexauthority.com

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" width="100%"
    height="100%">
    <mx:Script>
    <![CDATA[
    import mx.controls.Menu;

    function showMenu() {
    var theMenu:Menu = Menu.createMenu( null, theMenuXML );
    theMenu.move( theButton.x, theButton.y + theButton.height );
    theMenu.show();
    }
    ]]>
    </mx:Script>

    <mx:Button id="theButton" label="Open Popup" click="showMenu();" hide="true" />

    <mx:XML id="theMenuXML" >
    <menuitem label="Home" />
    <menuitem label="Page 2" />
    <menuitem label="Page 3">
    <menuItem label="Subset 1" />
    <menuItem label="Subset 2" />
    </menuitem>

    </mx:XML>


    </mx:Application>

    Nick_UK Guest

  5. #5

    Default Re: Popup menu on popup window

    Here, I think is your solution.
    Tracy
    [url]http://manish.revise.org/2005/04/menu-depths-in-modal-windows.html[/url]
    ntsiii Guest

  6. #6

    Default Re: Popup menu on popup window

    Thank you all for your help. Tracy's resolution worked. I don't use an xml file so had to do a little modification, I set my whole menu at once:

    myMenu.setDepthAbove(this);
    Peepio Guest

Similar Threads

  1. Replies: 9
    Last Post: October 18th, 04:32 PM
  2. Setting a popup window's base target to caller window?
    By saf_123 in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: July 6th, 11:01 AM
  3. can a popup window return data to parent window?
    By nadia in forum PHP Development
    Replies: 3
    Last Post: September 25th, 08:05 PM
  4. REQ: Help with popup window....
    By Barley Pop in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 8th, 08:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139