0 Replies Latest reply on Nov 6, 2008 11:46 AM by sbtang

    icons in Menu control

    sbtang
      Hi folks,

      I'm a relative newb to flex, so hopefully this question makes sense, but what I'm trying to do is get icons to show up in Menu control (mx.control.Menu). To do this, i'm setting my dataprovider to an array of objects where each object has the "icon" field defined.

      However, what i'm finding is that how I define the array affects whether the icons actuallly show up or not. First I tried defining the array this one and this works just fine.

      <mx:Array id="optionsMenuSource">
      <mx:Object label="Check For New Data" icon="@Embed('/assets/icons/ico_Refresh.png')" />
      <mx:Object label="Report Alert" icon="@Embed('/assets/icons/ico_Alerts.png')" />
      <mx:Object label="Updated Seed List" con="@Embed('/assets/icons/ico_SeedList.png')" />
      </mx:Array>

      However, when i define the array this way, it does not work.. I just get the text, but no icons. I also tried doing menu.iconfield = "icon" but that did not work either.

      menuArray = [{label:"Check For New Data", icon:"@Embed('/assets/icons/ico_Refresh.png')"},
      {label:"Report Alert", icon:"@Embed('/assets/icons/ico_Alerts.png')"},
      {label:"Updated Seed List", icon:"@Embed('/assets/icons/ico_SeedList.png')"}];

      Can someone help me figure out the diff here? It's killing me why the first method works and the second does not.