import mx.controls.Alert;
var myClickHandler=new Object();//定义操作对象
//更改按钮文本
Alert.okLabel = "确定";
Alert.cancelLabel = "取消";
var myAlert = Alert.show("您还没有登录!", "提示", Alert.OK | Alert.CANCEL,
_root, myClickHandler, "inforIcon", Alert.OK);
myAlert.setStyle("themeColor", "haloBlue");
myAlert.setStyle("borderStyle", "inset");
myClickHandler.click = function (evt) {
? trace(evt.detail); //获得evt(Alert中的按钮单击)的detail,这里是取得按钮对应的数值
? if (evt.detail == Alert.OK) trace('ok')
? else trace('cancel');
};