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

被折叠的 条评论
为什么被折叠?



