Hi Jeff – MenuBar.getMenuAt() returns a reference to
a Menu. getMenuAt() is a method on MenuBar and menuItems is a property on
MenuBar, which is why you encounter the errors below when you try to use those
APIs on a Menu. Since Menus are dynamically created as
needed, there is a possibility a nested child menu has not been created yet. As
menus get created, MenuBar adds those menus to its ‘menus’ array. ‘menus’
is a handy array that stores Menus created for that MenuBar control and you
might find that handy for your needs. If you can’t guarantee that the
menus have been created but you still want to walk your MenuBar, you can go at
it from a data-centric point of view. You can use the MenuBar’s
dataDescriptor to walk the MenuBar’s data looking for children
(hasChildren(), getChildren() will be handy) at each node. If children exist,
you know that node has a sub-menu. One last thing – it looks like your
original question was how to disable menu items. Since disabling/enabling is a
data-driven functionality (all you need to do is toggle the enabled property)
you can do it through the data bound to the MenuBar instead of walking the
MenuBar’s individual Menus and sub-Menus. For example, you can use e4x to
access the node you want to disable in the MenuBar dataProvider and set the
enabled attribute to false and boom, your MenuBar will show that menu item as
disabled without any extra work. Or, you can go at it through your MenuBar’s
dataDescriptor and find the node you want to disable and use
IMenuDataDescriptor.setEnabled() to disable that node. HTH – deepa From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of jeff tapper Sadly, thats where the problems started for me. I'm
able to get at -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
__,_._,___ |