个人总结flex应用 II【经典】
Mxml组件的打开和关闭特效
openDuration="1000" openEasingFunction="Bounce.easeOut"
closeDuration="1000" closeEasingFunction="Bounce.easeIn"
//菜单透明效果
background-color:#000000;
background-alpha:0.1;
border-style:solid;
drop-shadow-color:#000000;
drop-shadow-enabled:yes;
//展开所有节点
private function expandAll():void{
//tree.expandChildrenOf(tree.selectedItem,true);
for each(var item:XML in tree.dataProvider){
tree.expandChildrenOf(item,true);
}
}
//关闭所有节点
private function closeAll():void{
tree.openItems=[];
}
//添加右键菜单
private var meunu1:ContextMenuItem;
private var meunu2:ContextMenuItem;
public function init():void{
meunu1=new ContextMenuItem("hello");
meunu2=new ContextMenuItem("word",true);
meunu1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menu1Handle);
meunu2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,menu2Handle);
var menu:ContextMenu=new ContextMenu();
menu.hideBuiltInItems();
menu.customItems.push(meunu1);
menu.customItems.push(meunu2);
this.contextMenu=menu;
}
private function menu1Handle(e:ContextMenuEvent):void{
Alert.show("hello");
}
private function menu2Handle(e:ContextMenuEvent):void{
Alert.show(e.target.caption);
}
让TitleWindow不能被拖动
var win:PWindow=PWindow(PopUpManager.createPopUp(this,PWindow));
win.isPopUp=false;//设置这个属性就可以了哦
Tooltip文本换行
Tooltip 在ActionScript 中, 您使用 \n 转义的新行字符。
Tooltip 在 MXML 标签中, 您使用
//增加DataGrid的行号
private function orderNoLbl(item:Object,column:DataGridColumn):String{
return (this.userGrid.dataProvider.getItemIndex(item)+1).toString();
}
相关文档:
Alert.show()里面有多个属性,其中排在第三是flags,这个属性作用是在弹出的Alert提示框里面显示那一个或多个按钮,文档和书
籍一般只写该属性可以自由组合 Alert.OK, Alert.CANCEL ,Alert.YES
,Alert.NO四个选项,并用“|”分隔,其实也可以用数字编号代替的,用数字编号更为简便,以下是编号对应的按钮 ......
可以在Flex应用程序中嵌入各种元素。被嵌入的元素将编译进SWF文件。它们不是在运行时载入的,所以不必为应用程序部署原元素。
可以嵌入的图像格式有PNG、JPEG、GIF。嵌入后可以同时使用它的多个实例。
下面的例子使用[Embed]原标签经image嵌入应用程序,并且采用绑定ActionScript类的形式。这就可以绑定Image控件 ......
最近几天,一直在研究flex,说句实在的,其中的苦恼不是一句话两句话能说清楚的.没有接触过啊!不过现在总算是把数据库连上了,做出了自己想要的东西.废话少说,现在呢,我就把我做的代码贴出来,给大家看看,多提宝贵意见.
我用的是jdbc的连接方式(hibernate的连接方式我看网上有,所以就不贴出来了)
1.flex代码
<?xml version ......
mode有三种模式:ProgressBarMode.EVENT,ProgressBarMode.POLLED ,ProgressBarMode.MANUAL ,事件模式和轮询模式是最常用的模式。 在事件模式下,source 属性指定生成 progress 和 complete 事件的加载内容;在此模式下,应使用 UILoader 对象。 在轮询模式下,source 属性指定公开 bytes ......