20 Nisan 2010
Posted by admin
PopUpMenuButton with labelFunction
This example you can create PopUpMenuButton with labelFunction and XMLList.
Turkish
Bu örnek ile PopUpMenuButton oluşturabilirsiniz. XMLList ile veriler gönderilmektedir. Gelen veriler “popUpMenuButton_labelFunction” fonksiyonunda derlenerek tekrar PopUpMenuButton’a gönderilmektedir.
Main.mxml
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" width="537" height="320"> <fx:Declarations> <fx:XMLList id="itemsXML"> <item label="Item 1" /> <item label="Item 2" /> <item label="Item 3" /> <item label="Item 4" /> <item label="Item 5" /> <item label="Item 6" /> <item label="Item 7" /> <item label="Item 8" /> </fx:XMLList> </fx:Declarations> <fx:Script> <![CDATA[ import mx.controls.Alert; private function popUpMenuButton_labelFunction(item:Object):String { return item.@label; } ]]> </fx:Script> <mx:PopUpMenuButton labelFunction="popUpMenuButton_labelFunction" dataProvider="{itemsXML}" x="10" y="10"> </mx:PopUpMenuButton> </s:Application>
Demo :




No Comments Yet
You can be the first to comment!
Leave a comment