<? xml version="1.0" encoding="utf-8" ?> < mx:Application xmlns:mx ="http://www.adobe.com/2006/mxml" layout ="absolute" creationComplete ="initApp()" > < mx:Script > <![CDATA[ import flash.events.MouseEvent; internal function initApp():void{ btn.addEventListener(MouseEvent.CLICK,press_1,false,1); btn.addEventListener(MouseEvent.CLICK,press_2,false,4); btn.addEventListener(MouseEvent.CLICK,press_3,false,2); } internal function debug(str:String):void{ area_txt.text += str+" "; //注意这里是联加形式 } internal function press():void{ debug("press"); } internal function press_1(event:MouseEvent):void{ debug("press 1"); } internal function press_2(event:MouseEvent):void{ debug("press 2"); } internal function press_3(event:MouseEvent):void{ debug("press 3"); } ]]> </ mx:Script > < mx:TextArea x ="10" y ="10" height ="173" id ="area_txt" /> < mx:Button x ="33" y ="210" label ="按钮" id ="btn" click ="press()" /> </ mx:Application >