Sunday, March 28, 2010

How to measure a menu before it is...

Hi,

Probably a dumb question.. but... I create a menu like this: Menu.createMenu().?I will then do menu.show(x,y).?My x %26amp; y will depend on the size of the menu that is to be shown because I need to make sure it doesn't flow off the bottom or right sides of the screen.?But width %26amp; height of the menu object are 0 before it is shown.?Is there a good way to get the actual height %26amp; width of the menu before it is shown so I can position it correctly?

Thanks!

How to measure a menu before it is...

3.4 has improvements in this area. You call PopUpManager.addPopUp() on the menu, then its measuredHeight/measuredWidth should be valid so you can call show() with the right coordinates. I think if you don't use 3.4 you might get an error.

Alex Harui

Flex SDK Developer

Adobe Systems Inc.

Blog: http://blogs.adobe.com/aharui

No comments:

Post a Comment