flex 实现全文检索中的高亮显示代码
<mx:DataGrid id="dg" click="select()" dataProvider= "{modelLocator.resultList}" borderStyle="none"
verticalGridLines="false" horizontalGridLines="false" verticalScrollPolicy="off" rowCount="10"
fontSize="16" fontStyle="normal" fontThickness="0" width="100%" height="100%">
<mx:columns>
<mx:DataGridColumn dataField="programName " headerText="节目名称" >
<mx:itemRenderer>
<mx:Component>
<mx:HBox width="100%" height="100%" horizontalAlign="left" verticalAlign="middle" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
override public function set data (value:Object):void
{
if(value != null)
{
super.data = value;
programXYZ.htmlText = data.programName;
//Alert.show(this.programXYZ.text);
}
}
]]>
</mx:Script>
<mx:Text id="programXYZ" />
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
关键是重写了 override public function set data(value:Object):void 方法
相关文档:
源xml文件
<?xml version="1.0" encoding="iso-8859-1"?>
<books>
<stock>
<name>The Picasso Code</name>
<author>Dan Blue</author>
<category>Fiction</category>
<description>Cubist paintings reveal a secret society of people ......
最近在项目中要用到flv播放器,由于flex自带的VideoDisplay组件不是很好用,就自己简单实现了一个,界面不是很美观,但功能都有了,正可谓麻雀虽小五脏俱全。下面是播放器的代码,还不会用flash做flv播放器的朋友,可以参考参考。
Player.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="ht ......
We're going to keep this post lean and mean, and get down to
business with 10 Tips that will keep your Flex applications fast, lean,
and responsive.
Rule # 1: Clean up after yourself
In general, it is good practice to maintain clean code. Not only
in the sense of having properly formatted and ......
前言
最近,正竭斯底里地重构flex技术平台开发的产品【wizBuilder CS】。以前为赶功能,界面部分代码都写得好乱,现在是时候修理下自己作的孽了,顺便为产品添加多语言支持(Localization)。
主要任务
代码重构
多语言支持
添加新功能、修改现有功能、去掉不合理的功能
修正重构过程中发现的 ......
文章一:http://blog.csdn.net/eyking/archive/2009/10/21/4702330.aspx
Flex就是致力于RIA的应用,Adobe为了扩大战场,推出了AIR环境,那么此时采用Flex编写的程序在浏览器中与桌面环境下都可以很好的移植了。像Flex与Flash这样奇怪的东西,战场不仅仅在浏览器上,还跑到了桌面环境下。一个很重要的安全模型就被提出了:F ......