Not working...
<mx:Image source="{menu.attribute.ic
Gives the Error: cannot load ""
The contents of menu.attribute.icon when dumped = "[class warningIcon]"
Main Topics
Browse All TopicsI have the following XML:
<mx:XMLList id="menu">
<menuitem label="Icon and function" icon="{warningIcon}" function={myFunction}/>
</mx:XMLList>
I know I can access the label text by using menu.attribute('label'). But how can I access the icon and function pointers? <mx:Image source={menu.attribute(ico
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi Again just to recap the xmllist code you have provided is invalid and generates
Attempting to initialize inherited property 'menu' of type 'mx.controls.FlexNativeMen
and that is after putting the required quotes around the function like this
<menuitem label="Icon and function" icon="{warningIcon}" function="{myFunction}"/>
im a bit confusted here as to what you are trying to achieve, please provide me more info and i will create the code for you to parse XML and retrieve the label, icon and function fields.
Regards
Chris
P.S. If this question is no longer required then please clean up this question as is is getting quite old now.
I'm not sure how pertinent this is to your question, but for MenuBar, icon should be a String.
By using icon="{warningIcon}" you are telling flex to parse warningIcon and that returns a class. I would be surprised in this scenario if you even see the icon in your menu.
What may help though is knowing how MenuBar turns this...
icon="warningIcon"
... into an image.
What it does is to call...
iconClass = Class(systemManager.getDef
... where "icon" is the String from the XML.
Maybe you need to do something similar in your code?
Business Accounts
Answer for Membership
by: Robinsonx6Posted on 2008-02-20 at 05:02:50ID: 20937355
menu.attribute.icon
if its actual XML