How to get html text in a Flex Alert panel.
A client asked me to do something seemingly simple.
"I want the Alert to have just this one sentence bolded."
Well, it's not exactly simple, so here's how you do it:
there are two solutions as below :
import mx.core.IUITextField;
use namespace mx.core.mx_internal;
message +="Press Yes to continue or No to cancel";
}
if(message.length>0){
Alert.yesLabel="Yes"
var alert:Alert=Alert.show(message,"Alert",3,null,alertHandlerForSO);
// alert.mx_internal::alertForm.mx_internal::textField.htmlText = message;
IUITextField(alert.alertForm.textField).htmlText = message;
}
=========================
¸ü¶à Flex 4 ʾÀý£¬Çëµ½ http://www.slsay.com
Alert ¿Ø¼þÊÇ Halo ¿Ø¼þÖеÄÒ»ÖÖ¡£
ËùÓÐµÄ Flex ×é¼þ¶¼Äܹ»µ÷Óà Alert ÀàµÄ¾²Ì¬·½·¨ show ( ) £¬À´´ò¿ªÒ»¸ö´øÓÐÏûÏ¢¡¢±êÌâ¡¢°´Å¥ºÍͼ±íµÄµ¯³öʽ¶Ô»°¿ò¡£
µ±µã»÷ÁËÒ»¸ö°´Å¥Ê±£¬ Alert ¿Ø¼þ½«±»¹Ø±Õ¡£
Alert.show ( ) ·½·¨µÄÓï·¨ÈçÏ£º
public static show (
text:String,
title:String=null,
flags:uint=mx.controls.Alert.OK,
parent:Sprite=null,
clickListener:Function=null,
iconClass:Class=null,
defaultButton:uint=mx.controls.Alert.OK
):Alert
·µ»ØÒ»¸ö Alert ¿Ø¼þ¶ÔÏó¡£
ϱíÃèÊöÁË show ( ) ·½·¨µÄ²ÎÊý£º
²ÎÊý
ÃèÊö
text
¶Ô»°¿òÖеÄÏûÏ¢Îı¾
title
¶Ô»°¿ò±êÌâÀ¸ÖеÄÎı¾
flags
Ö¸¶¨¶Ô»°¿ò°´Å¥°´Å¥
mx.controls.Alert.OK £º Ok °´Å¥
mx.controls.Alert.YES £º Yes °´Å¥
mx.controls.Alert.NO £º No °´Å¥
mx.controls.Alert.CANCEL £º Cancel °´Å¥
parent
Alert ¿Ø¼þµÄ¸¸¶ÔÏó
clickListener
Ö¸¶¨ click ʼþµÄÕìÌýÆ÷
iconClass
Ö¸¶¨¶Ô»°¿òÖÐÏûÏ¢Îı¾×ó²àµÄͼ±ê
defaultButton
ʹÓÃÒ»¸ö±êÖ¾²ÎÊýµÄºÏ·¨ÖµÖ¸¶¨Ä¬Èϰ´Å¥¡£µ±Óû§°´Ï»سµÊ±£¬´Ë°´Å¥¾Í±»Ñ¡ÖУ¬ÆäĬÈÏÖµÊÇ Alert.OK.
ҪʹÓà Alert ¿Ø¼þ£¬ÐèÒªÒýÈë Alert À࣬Ȼºóµ÷Ó
Ïà¹ØÎĵµ£º
<meta http-equiv="Refresh" content="0; url=">
Õâ¸öÒ³Ãæ±¾À´ÊÇ˵ÿ¸ô0ÃëË¢ÐÂÒ»ÏÂÒ³Ãæ£¬²¢Ìø×ªµ½urlËùÖ¸¶¨µÄÒ³ÃæÈ¥£¬Æäʵ¾ÍÏ൱ÓÚÒ³ÃæÌø×ª¡£µ«ÊÇʵ¼ÊÊÇÓÉÓÚurlΪ¿Õ£¬ÕâÑù¾Í²»Í£µÄÇëÇóÕâÕÅÒ³Ãæ£¬µ¼ÖÂÒ³Ãæ¿ñË¢¡£ÔÚ´óÐÍÓ¦ÓÃÖÐÓÈÆä×¢ÒâÕâµã¡£ ......
’shift’ + ‘tab’:×óÒÆ´úÂë; [·½±ã]
”tab’:ÓÒÒÆ´úÂë; [·½±ã]
‘alt’ + ‘/’:´úÂëÌáʾ,µ¼ÈëÀà; »òÕß×Ô¼ºÔÚkeyÀïÕÒµ½ content assist×Ô¼ºÉèÖÃ
‘ctrl’ + ‘¿Õ¸ñ’:ͬÉÏ; Èç¹ûÓëÊäÈë·¨Çл»¿ì½Ý¼üÏàͬÐèÒª½«ÊäÈë·¨µÄ¿ì½Ý¼ü¸ü¸Ä³ÉÆäËû×éºÏ[·½ ......
package util
{
public class MD5
{
private var hexcase:int = 0;
private var strsize:int = 8;
static private var md5:MD5;
static public function getInstance():MD5
{
if(!md5)
{
md5 = new MD5()
}
return md5;
}
public function getMD5(s:String):String
{
return binl2hex(core_md5(str2binl(s ......
<script language="javascript">
var o = document.body;
//´´½¨±í¸ñ
function createTable(w,h,r,c)
{
var table = document.createElement("table");
var tbody = document.createElement("tbody");
table.width = w;
table.height = h;
table.border = 1;
for(var i=1;i<=r; ......