1 Reply Latest reply on Apr 2, 2008 6:59 AM by Gregory Lafrance

    <ui:ContextMenuItem> in MXML causes Error 1136: Incorrect number of arguments

    Joubert Nel
      Hello,

      I'm trying to define a context menu declaratively like so:


      quote:

      <ui:ContextMenu id="editChartDataContextMenu">
      <ui:customItems>
      <mx:Array>
      <ui:ContextMenuItem caption="Clear"/>
      </mx:Array>
      </ui:customItems>
      </ui:ContextMenu>


      However, the Flex compiler gives an error for the line that reads "<ui:ContextMenuItem ....". (the line in boldface).
      The error is: 1136: Incorrect number of arguments. Expected 1.

      Needless to say, I have experimented with varying number of attributes, but no luck.
      I have googled in vain to find examples where context menus are built up using markup; all examples seem to be imperative (ActionScript) code, instead of declarative.

      Any ideas?

      Joubert