个人总结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();
}
相关文档:
下面说一下我理解后的用法吧。仅仅是个记录啦……-。-貌似没什么技术含量。
首先,给validator起个id不用多说啦;
required 是个boolean类型的值,大致的意思是说,验证的这个值是不是必须的(这不是废话嘛?不是必须的,我干嘛要验证……)好吧,设置为true;
requiredFieldError 这个东 ......
Adobe Flex开发与传统的Web开发有很多不同之处。正确的理解和利用这些不同之处,可以帮助我们创建更丰富的用户体验,也可以反过来增加网站的可用性以及浏览和更新速度。Flex还提供了大量的组件和技术库来让Web开发更加轻松——它提供的强大工具要远远超过传统Web 2.0中的异步JavaScript和XML(Ajax)应用。此外, ......
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Zoom effect. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Style />
<mx:Script>
& ......
flex builder 设置非系统默认字体:
存在问题:text不能设置bold,否则不起作用。
方法一:(css)
<mx:Style>
@font-face
{
font-family: myFont;
& ......