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 À࣬Ȼºóµ÷Ó
Ïà¹ØÎĵµ£º
1.avi¸ñʽ
´úÂëÆ¬¶ÏÈçÏ£º
<object id="video" width="400" height="200" border="0" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA">
<param name="ShowDisplay" value="0">
<param name="ShowControls" value="1">
<param name="AutoStart" value="1">
<param name="Auto ......
ת×Ô£ºhttp://www.blogjava.net/lishunli/archive/2010/01/07/308618.html
Javadocת»»chm°ïÖúÎĵµµÄËÄÖÖ·½·¨×ܽá
&nb ......
Ò»°ãʼþ ʼþ ä¯ÀÀÆ÷Ö§³Ö ÃèÊö
onClick IE3|N2|O3 Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷
onDblClick IE4|N4|O Êó±êË«»÷ʼþ
onMouseDown IE4|N4|O Êó±êÉϵİ´Å¥±»°´ÏÂÁË
onMouseUp IE4|N4|O Êó±ê°´Ïºó£¬ËÉ¿ªÊ±¼¤·¢µÄʼþ
onMouseOver IE3|N2|O3 µ±Êó±êÒÆ¶¯µ½Ä³¶ÔÏó·¶Î§µÄÉÏ·½Ê±´¥·¢µÄʼþ
onM ......
javascript ¿ØÖÆ htmlÔªËØ ÏÔʾ/Òþ²Ø
1¡£±àдjsº¯Êý
<script type="text/javascript">
function display(y){$(y).style.display=($(y).style.display=="none")?"":"none";}
function $(s){return document.getElementById(s);}
</script>
2. ÒªÏÔÊ ......