For Menu controls, if the data provider is an Array of Strings, Flex
uses each String value as the label.  When a menu item is clicked, the
item's label is passed to the ItemClickEvent's label property.  It would
be necessary to use name-value pairs, in the dataProvider, if you used
the Menu's labelField or labelFunction properties.

-TH

--- In flexcoders@yahoogroups.com, "fred44455" <fred44...@...> wrote:
>
>
> The label is not defined in this example. How can the label
> be called without an error? (('right side with ' + event.label)"/)
> Thanks for your time.
>
> <?xml version="1.0"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
>
> <mx:Script>
> public function showMsg(msg:String):void
> {
> mx.controls.Alert.show('You just clicked on ' + msg);
> }
> </mx:Script>
>
> <mx:Panel width="100" height="100">
> <mx:PopUpMenuButton id="menuBtn"
> dataProvider="{['One','Two','Three']}"
> click="showMsg('left side')"
> itemClick="showMsg('right side with ' + event.label)"/>
> </mx:Panel>
> </mx:Application>
>


Reply via email to