悠索

少小离家老大回,乡音无改鬓毛衰。

« 常用的jquery小技巧选色器控件ColorPicker »

警告控件Alert

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:Button id="btn" click="showAlert(event)" label="Alert"/>
<mx:Label id="lbl"/>

<mx:Script>
<![CDATA[
 import mx.events.CloseEvent;
 import mx.controls.Alert;
 import mx.events.MenuEvent;
 private function showAlert(evt:MouseEvent):void {
  var alert:Alert = Alert.show(
  "Button was clicked","Alert Window Title",
  Alert.OK|Alert.CANCEL|Alert.NO|Alert.YES,
  this,onAlertClose);
 }
 private function onAlertClose(evt:CloseEvent):void {
  switch(evt.detail) {
   case Alert.OK:
    lbl.text = "OK Clicked";
    break;
   case Alert.CANCEL:
    lbl.text = "CANCEL Clicked";
    break;
   case Alert.NO:
    lbl.text = "NO Clicked";
    break;
   case Alert.YES:
    lbl.text = "YES Clicked";
    break;
  }
 }
]]>
</mx:Script>
</mx:Application>

 

  • 相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Copyright (C) 2008-2012 0451sky.com Inc.,All Rights Reserved.