creationComplete="initApp()"> import mx.controls.Alert; private function initApp():void { b1.addEventListener("click",function(e:Event):void {Alert.show("The button was clicked");}); }