Flex 4中如何创建边角圆滑Alert的例子

接下来的例子演示了Flex 4中如何通过自定义Skin和radiusX,radiusY属性,创建边角圆滑Alert。(Flex 3以及早期版本是cornerRadius属性)

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

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



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

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




下面是skins/CustomAlertSkin.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; } ]]>


10






























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

Leave a Reply

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