Select to view content in your preferred language

Adding menuicon to menubar items

563
0
05-12-2011 11:12 AM
DarrenGemoets
Occasional Contributor
Hello.  I'm fairly new to Flex and ActionScript and have inherited a FlexViewer-based app.  My question does not appear to be FlexViewer-specific, so I hope this is the correct forum.

We have a working menubar, and I am trying to add menuicons to some of the entries.  Sounds simple, and I've seen some MMXL-based samples, but this menubar was created in an ActionScript file in which the menubar is an XMLList.

My code looks something like this (abbreviated, of course):
package widgets.HeaderController
{

// [deletia]

public class MyMenuBar extends MenuBar
{
 [Embed(source="assets/images/i_search.png")]
 public var myIcon:Class;

 private var xmlMenuBar:XMLList = 
  <>
  <menuitem label="Main Menu">
   <menuitem label="Tools" >
    <menuitem label="Print"  widgetNumber="5"/>
    <menuitem label="Start Over"/>
    <menuitem label="Find Address or Place" widgetNumber="0"/>
    <menuitem label="Quick Search" icon="myIcon" widgetNumber="1"/>
   </menuitem>
  </menuitem>
  </>;

  [Bindable]
  private var baseMap:Map = null;

 // deletia

}
}

Anything jump out at anybody?
Tags (2)
0 Kudos
0 Replies