Flex 4中如何设置Alert背景图片的例子

接下来的例子演示了Flex 4中如何通过borderSkin样式,设置Alert背景图片。

让我们先来看一下Demo可以点击这里察看源代码):

下面是完整代码(或点击这里察看):
下面是main.mxml:



@namespace s “library://ns.adobe.com/flex/spark”;
@namespace mx “library://ns.adobe.com/flex/halo”;

mx|Alert {
borderSkin: ClassReference(“skins.CustomPanelBorderSkin”);
}






下面为skins/CustomPanelBorderSkin.mxml的代码:



1) { cbbg.height = em.bottom – 1; cbdiv.bottom = cbbg.height; cbbg.visible = cbdiv.visible = true; } else { cbbg.visible = cbdiv.visible = false; } super.updateDisplayList(unscaledWidth, unscaledHeight); } private static var panels:Object = {}; private static function isPanel(parent:Object):Boolean { var s:String = getQualifiedClassName(parent); if (panels[s] == 1) { return true; } if (panels[s] == 0) { return false; } if (s == “mx.containers::Panel”) { panels[s] == 1; return true; } var x:XML = describeType(parent); var xmllist:XMLList = x.extendsClass.(@type == “mx.containers::Panel”); if (xmllist.length() == 0) { panels[s] = 0; return false; } panels[s] = 1; return true; } ]]>



















































代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Leave a Reply

Your email address will not be published. Required fields are marked *