ITeye博客

HTML Text in a Flex Alert box

Blackbaby · 2011-01-21 14:26 · ActionScript3/Flex4 · Web前端 · HTML · Flex · Access · Markdown

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;

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。