var someObject:DisplayObject = getChildByName("butgallery") as DisplayObject someObject.addEventListener(MouseEvent.CLICK, ClickGalleryPic, false, 0, true );