flex特效(3):扩展基本控件实现一个自定义图标的导航树
来源:百度文库 编辑:神马文学网 时间:2024/04/26 22:42:10
flex特效(3):扩展基本控件实现一个自定义图标的导航树
时间:2010-08-06 13:02来源:未知 作者:admin 点击:53次flex特效收集与汇总(3):扩展基本控件实现一个自定义图标的导航树扩展了TreeItemRenderer类。在commitProperties方法,ColorMatrixFilter应用到现有的文件夹图标(“图标”属性)。
关键代码
- override protected function commitProperties():void
- {
- super.commitProperties();
- if ( icon )
- {
- var matrix:Array = new Array();
- switch (TreeListData( listData ).depth )
- {
- case 1:
- matrixmatrix = matrix.concat([1, 0, 0, 0, 0]); // red
- matrixmatrix = matrix.concat([0, .25, 0, 0, 0]); // green
- matrixmatrix = matrix.concat([0, 0, .25, 0, 0]); // blue
- matrixmatrix = matrix.concat([0, 0, 0, 1, 0]); // alpha
- icon.filters = [ new ColorMatrixFilter( matrix) ]
- break;
- case 2:
- matrixmatrix = matrix.concat([.25, 0, 0, 0, 0]); // red
- matrixmatrix = matrix.concat([0, 1, 0, 0, 0]); // green
- matrixmatrix = matrix.concat([0, 0, .25, 0, 0]); // blue
- matrixmatrix = matrix.concat([0, 0, 0, 1, 0]); // alpha
- icon.filters = [ new ColorMatrixFilter( matrix) ]
- break;
- case 3:
- matrixmatrix = matrix.concat([.25, 0, 0, 0, 0]); // red
- matrixmatrix = matrix.concat([0, .25, 0, 0, 0]); // green
- matrixmatrix = matrix.concat([0, 0, 1, 0, 0]); // blue
- matrixmatrix = matrix.concat([0, 0, 0, 1, 0]); // alpha
- icon.filters = [ new ColorMatrixFilter( matrix) ]
- break;
- default:
- icon.filters = [];
- break;
- }
- }
- }
效果演示:
完整代码请到:http://www.tricedesigns.com/portfolio/colorfolders/srcview/index.html 下载。
flex特效(3):扩展基本控件实现一个自定义图标的导航树
Symbian添加一个控件的基本步骤
Symbian添加一个控件的基本步骤
自定义控件
日历控件的实现
自定义验证控件CustomValidator的用法实例
自定义验证控件CustomValidator的用法实例
自定义win7库文件夹的图标
图标菜单(菜单图标)的实现
自定义导航
使用 ASP.NET Atlas PageNavigator控件实现客户端分页导航
Flex精华摘要 3:基本语法
symbian自定义控件
彻底删了自定义隐藏不活动的图标
自定义 W3C 扩展日志记录
创建自定义 AJAX 客户端控件
Silverlight 自定义控件模板管理
Windows Forms中通过自定义组件实现统一的数据验证(一) - 一个程序员的自省 ...
Flex特效汇总(1)
Flex特效汇总(2)
各种导航链接图标
构建一个Flex程序
Windows Workflow: 构建自定义活动以扩展您的工作流的作用范围(转MSDN)
Silverlight实例教程 - 自定义扩展Validation类,验证框架的总结和建议