Actually that's right, the menu's position is set *after* the
"menuShow" event has been dispactched (see Menu.as). So you can set up
callLater() and adjust the position in your callback. That should do
the trick!

By the way, Menu already tries to adjust for the horizontal position.
>From Menu.as:

       // Adjust for menus that extend out of bounds
        if (this != getRootMenu())
        {
            var shift:Number = x + width - screen.width;
            if (shift > 0)
                x = Math.max(x - shift, 0);
        }

On 4/24/07, kkinaru <[EMAIL PROTECTED]> wrote:
> Thanks a lot, Manish.
>
> >
> > If I'm not wrong, menu objects are directly parented by the system
> > manager. You can verify this by trace()'ing menu.parent. You want to
> > use that parent object with localToGlobal().
>
> In createMenu, first parameter is assigned to menu.parent property, I
> used null, so, ok, my menu.parent is System Manager for all (menu and
> submenus). But I've problems with submenus, because
> menu.parent.localToGlobal(event.menu.x, event.menu.y) returns (0, 0)
> for every submenus. (system_manager === menu.parent)
>
> I'm listening the onShow event, is this correct?
>
> It seems that the system buid the menus in the position 0,0 and then
> it moves them to their places.
> I'm loading data from an external XML and I'm saving main menu in a
> class variable and move it manually to its place, and it is the only
> menu that doesn't return (0,0) in localToGlobal...
>
> I'm a bit confused... any other ideas?
>
> Thankou all very much for these minutes.
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
>
>
>

Reply via email to