I'm having a heck of a time positioning menus. I've got a set of 
Link components within a HBox container which is within a VBox 
container.

<mx:VBox>
<mx:HBox id="myBox">
<mx:Link label="Open Menu" click="showMenu(event)"/>
<mx:Link label="Open Menu2" click="showMenu(event)"/>
</mx:HBox>
</mx:VBox>

The showMenu() function looks like this:

function createAndShow(event){
var myMenu:Menu = Menu.createMenu(null, myDataProvider);
var myX:Number = event.target.x;
var myY:Number = event.target.y + event.target.height;
myMenu.show(myX, myY);
}

When I click on the link, I would like the menu to appear directly 
below the link. However, rather than appearing directly below the 
link, it is appearing at position x=0, y=22. The value of myX is 0 
and of myY is 22, which must be the position of the link within the 
HBox?

I tried changing the createMenu function from null to myBox--the id 
assigned to the HBox. I also tried using LocalToGlobal. Haven't 
had any luck yet though. What am I missing here???



Reply via email to