This content has been marked as final. Show 5 replies
i don't have much experience with this particular component, but assuming that it operates like some of the others, you can probably resolve a reference like so:
myMenuBar.getMenuAt(2) //or whichever index it is that you need
you can either assign this to a local variable
var sub2:Menu = myMenuBar.getMenuAt(2)
or just continue on with the dot syntax
myMenuBar.getMenuAt(2).enabled = true
I know the solutions that you suggested but I need to get a referance sub of submenu. I've got a menebar component that gets the struct from a XML source and then for example menu struct like this:
File(level 1)->Resent Files(level 2)->Document 1 (level 3)
I need to get a referance to the third menu that includes the "Document 1" menu item.
I can get a referance by the method:
var sub2:Menu = myMenuBar.getMenuAt(0)
If I ue this code, I can get a referance to File menu. But I need to get a referance to menu that includes the "Document 1" Menu item.
There is not a property that can get a menu referance to a sub menu of a menu.
like i said, i'm not an expert on this component, but try this:
var mFile:Menu = myMenu.getItemAt(0)
var sRecent:Menu = File.getItemAt(2)
doc1 = sRecent.getItemAt(0) //not sure what the type dec should be, object maybe?
I think I've to ask real question,
How can I set "_alpha" property of a menubar and all of its sub menus?
I used this statement but the sub menu's opacity didnt changed.
And I got a referance to the first menu of the menubar (for ex. File menu) and I changed its _alpha property to 30 but at this time, the opacity of sub menu of File menu was 100. :S