flex 笔记(更新中。。。。)
1、如果要设置Validator验证组件里面提示字的大小,可以在mxml中加入
<mx:Style>
<!--[CDATA[
.errorTip
{
fontSize: 12;
}
]]-->
</mx:Style>
2、设置tooltip中的样式(如字体大小,颜色)可在mxml中的creationComplete的initApp()加入
StyleManager.getStyleDeclaration("ToolTip").setStyle("fontSize",15);
StyleManager.getStyleDeclaration("ToolTip").setStyle("backgroundColor","#F7F1F1");
相关文档:
根据别人写了类,自己又增加了一部分,贴出来分享
/*获得两个日期之差 */
public static function getDateDiff(startDate:Date, endDate:Date):int
{
var diff:Number = (Number(endDate) - Number(startDate))/(3600000*24);
return diff;
}
/* 获得现在日期 */
public static function getDate() ......
比如我要设置当鼠标移动到label上时,鼠标形状变成手型
具体代码
<mx:Label text="click me"
useHandCursor="true"
buttonMode="true"
mouseChildren="false"/>
只要设置:
use ......
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
import mx.collections.ArrayCollection;
......
前期准备:
点击File菜单 -> New -> MXML Component,然后弹出一个对话框。
在对话框中输入组件名,选择此组件继承的类型,如:Canvas,DataGrid,ComboBox …… 等。
然后选择组件的大小,点击Finish即可。
关于组件继承的类型,假设Based on  ......
对于习惯了使用桌面应用程序的用户而言,回车后下移焦点到下一个编辑组件中的小功能,是非常贴心的,利用flex中的KEY_DOWN事件可以方便的实现回车下移焦点,代码如下:
<?xml version="1.0" encoding="utf-8"?>
<mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplet ......