ned*_*lad 0 apache-flex flash mxml actionscript-3 flash-builder
当用户点击删除按钮时,我会弹出一个警告.但是,在创建警报时,尽管没有用户输入,它仍会触发Yes函数.
显然,使用删除按钮这很糟糕.
        protected function handleDelete(event:Event): void {
            showAlert();
        }
        private function showAlert():void{
            Alert.yesLabel = "Delete";
            Alert.noLabel = "Cancel";
            Alert.show("Are you sure you want to delete this?", "Confirm Delete", Alert.YES|Alert.CANCEL, this, delete(), null, Alert.CANCEL);
        }
Run Code Online (Sandbox Code Playgroud)
不确定原因,但无论用户输入什么,都会在创建警报时触发delete().
警报是Flex默认警报,没有覆盖或任何内容.