Hmmm – well our Embed expert says that you can make the variable for the embedded asset static, but that seems to be your problem. I’ll file a bug on your behalf, but for now, don’t make exitOn static and the icon should show up.

 

Let me know if it doesn’t –

 

Deepa

Flex SDK

 

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kelly Birr
Sent: Wednesday, June 28, 2006 4:26 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Icons in menu - not working

 

I've been racking my brain trying to get icons in the menu bar.  I think I'm doing exactly what the docs say but I cannot get any icon to render.  The label and actions work perfectly but the icon does not show up.  The icon is embedding properly as I can see it in the "icon" property of a button in the same file.  I've also tried putting the path to the icon file in the xml, no joy.

 

My Menu XML Is:

<menu>

    <menuitem label="File">
        <menuitem label="Open" data="" />
        <menuitem type="separator" />
        <menuitem label="Exit" data="" icon="exitOn" />
    </menuitem>

</menu>

 

My MXML is:

<mx:Script>

  <![CDATA[
        [Embed(source="images/icons/iconExitOn.gif")]
        public static const exitOn:Class;

  ]]>
 </mx:Script>

 <mx:MenuBar id="menu" width="100%" x="0" y="0" height="27" dataProvider="{menuXml}" showRoot="false" 
   cornerRadius="3" itemClick="menuHandler(event)" labelField="@label" iconField="@icon" />

   
I cannot find any samples anywhere with icons in the menu,  Is this still supported?  Can anyone tell me what i'm doing wrong?  I am using Flex 2.0 RTM

 

- Kelly

__._,_.___

--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to