1 Reply Latest reply on Sep 15, 2010 3:12 AM by See Sam Jagan

    Writing a Programmatic Skin for Menu control

      I am having difficulty understanding how to write a programmatic skin the Menu control, and there seems to be no samples available.

      It is simple for other controls; for example, MenuBar - the documentation clearly lists (under the styles attributes) that there are skins such as "itemDownSkin", "itemOverSkin", and "ItemUpSkin" available to be overridden. ( the reference doc for MenuBar is at http://livedocs.adobe.com/flex/2/langref/mx/controls/MenuBar.html,

      So you just you write your own class (which extends Programmatic Skin and implements an UpdateDisplayList function to do whatever drawing you want). and specify that your class should be used to the draw whichever skins that you want to be overriden. Again, the general technique is nicely documented at http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=skinning_071_09.html

      However, for the Menu control, if you look at the documentation for this class ( http://livedocs.adobe.com/flex/2/langref/mx/controls/Menu.html ) there are no similar skin styles available for you to implement. There is a "separatorSkin" style available to be overriden, but what about for the menu item itself? Is this just not possible, or is there some other way to do it?

      If anyone out there has experience with this, any pointers would be greatly appreciated. Thanks!

      Ed (Slim222)