<?xml version="1.0"?> <!-- controls\bar\LBarSimple.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import mx.controls.Alert; private function show(str:String):void { switch(str) { case "监控": f1(); break; case "管理": f2(); break; } } public function f1():void { Alert.show("监控"); } public function f2():void { Alert.show("管理"); } ]]> </mx:Script> <mx:LinkBar borderStyle="solid" itemClick="show(String(event.label))"> <mx:dataProvider> <mx:String>监控</mx:String> <mx:String>管理</mx:String> </mx:dataProvider> </mx:LinkBar> </mx:Application>