AlertBox With No Buttons! (HACK)

本文介绍了一种使用Flash技术实现无按钮警告框的方法。通过移除警告框中的按钮达到锁定用户界面直至操作完成的目的。这是一种非常实用的技术手段,适用于需要临时禁用用户交互的场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Browsing around EE today, I found an interesting question. This person wanted an AlertBox that had no buttons at all. The goal was to have the identical functionality / look as an alert, but to only display a message such as “Saving Changes…”. This is something that I do all over the place, and have written custom components specifically for locking the UI until an operation is complete.

However, if you don’t mind using some nasty hacks, this functionality can be accomplished in only a couple lines of code.

 

private var theAlert:Alert;

public function showAlert():void
{
  theAlert = Alert.show("Saving Changes...", "", Alert.OK);
  theAlert.mx_internal::alertForm.removeChild(
    theAlert.mx_internal::alertForm.mx_internal::buttons[0]);
}

public function hideAlert():void
{
  PopUpManager.removePopUp(theAlert);
}

 

It’s a hack, but it works really good!

 

原文链接:http://maclema.com/b/2008/01/10/alertbox-with-no-buttons-hack/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值