Flex addEventListener传递参数
//法一:函数传递 var imgurl:String="assets/images/1.png"; var loader:Loader = new Loader(); loader.load(new URLRequest(imgurl)); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,function(event:Event){afterLoad(event,imgurl);} ); public function afterLoad(event:Event,url:String):void { hBox.setStyle("backgroundImage",url); } //法二:函数内赋值 var imgurl:String="assets/images/1.png"; var loader:Loader = new Loader(); loader.load(new URLRequest(imgurl)); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,function(event:Event){afterLoad(hBox.setStyle("backgroundImage",imgurl);} );