2010年5月7日星期五

Trying Flex Custom MXML component

這個星期開始寫一些UI的module,
也做了一個custom mxml component,...override 了它的 data setter () function, ...
覺得flex 內的item Render 是一樣很好玩的東西,
有了它們, 我能夠張 TileList, DataGrid...等的類改頭換面,
簡單地做出一些不平凡的components!


以下是 一例子:



[CDATA[
override public function set data(value:Object):void {
// this is critical since we only want to inject additional logic
super.data = value;
// new behavior
var minAge:Number = 40;
if (data.age <>) {
setStyle("color",0xFF0000);
} else {
setStyle("color",0x000000);
}
}
]]>





=============
http://blog.flexdevelopers.com/2009/07/flex-examples-creating-custom-visual.html

沒有留言: