A quick and easy way to render HTML text with the body of a Flex Alert box.
There is no API to set the htmlText property of the Alert text field, but you can access it using the mx_internal namespace.
import mx.controls.Alert;
import mx.core.IUITextField;
var title:String ="HTML Alert!";
var htmlBody:String = "This is my HTML message with <b>Bold</b> text and <br/> HTML formatting <b/>";
var alert:Alert = Alert.show(str, htmlBody);
// now target the Alert text field (after we have opened it) and set the HTML text property use namespace mx.core.mx_internal;
IUITextField(alert.alertForm.textField).htmlText = htmlBody;
本文介绍了一种在FlexAlert框中快速轻松地呈现HTML文本的方法。通过使用mx_internal命名空间,可以设置Alert文本字段的htmlText属性来显示带有HTML格式的警告消息。
2030

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



