弹出框选择

Posted on 2013-08-01 16:31  诸葛小北  阅读(186)  评论(0编辑  收藏  举报
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" 
               applicationComplete="init()"
               >
        <fx:Script>
            <![CDATA[
                import mx.controls.Alert;
                import mx.events.CloseEvent;
                
                protected function init():void{
                 Alert.show("你要保存你的更改吗","保存",Alert.YES|Alert.NO,this, onAlertClose);
                }
               
                protected function onAlertClose(event:CloseEvent):void{
                   if(event.detail == Alert.YES)
                       statuseField.text ="你选择了YES"
                   else statuseField.text = "你选择了NO"
                           
                }
            ]]>
        </fx:Script>
             <s:Label id="statuseField" horizontalCenter="0" verticalCenter="0" text="选择以前"/>
</s:Application>
View Code

Copyright © 2024 诸葛小北
Powered by .NET 8.0 on Kubernetes