易截截图软件、单文件、免安装、纯绿色、仅160KB

关于flex中tree的事件,展开事件

(1)tree点击事件public function handleList(ev:ResultEvent)
{
sourceList=ev.result as ArrayCollection;
}
private function tree_itemClick(evt:ListEvent):void {
var item:Object = Tree(evt.currentTarget).selectedItem;
if (pmtree.dataDescriptor.isBranch(item)) {
pmtree.expandItem(item, !pmtree.isItemOpen(item), true);
}
Alert.show(item["id"].toString());
}

 
(2) 自动展开
Tree. openItems=数据源;  即可
(3) Flex中如何利用dataDescriptor和labelFunction属性,以及hasChildren()和getChildren()函数设置Tree中包含子节点个数。1. <?xml version="1.0" encoding="utf-8"?>
2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
3. layout="vertical"
4. verticalAlign="middle"
5. backgroundColor="white">
6.
7. <mx:Script>
8. <!--[CDATA[
9. private function tree_labelFunc(item:XML):String {
10. var label:String = item.@label;
11. if (tree.dataDescriptor.hasChildren(item)) {
12. label += " (" + tree.dataDescriptor.getChildren(item).length + ")";
13. }
14. return label;
15. }
16. ]]-->
17. </mx:Script>
18.
19. <mx:XML id="treeDP">
20. <root>
21. <node label="i) One" />
22. <node label="i) Two" />
23. <node label="i) Three" />
24. <node label="i) Four">
25. <node label="ii) One" />
26. <node label="ii) Two" />
27. <node label="ii) Three">
28. <node label="iii) One" />
29. <node label="iii) Two" />
30. </node>
31. <node label="ii) Four" />
32. </node>
33.


相关文档:

eclipse安装flex插件

1.下载eclipse的插件包:FB3_WWEJ_Plugin.exe
地址:http://trials.adobe.com/Applications/Flex/FlexBuilder/3/FB3_WWEJ_Plugin.exe
2.在任意目录建一个以下结构的目录:flex_plugin->eclipse->plugins和features
3.进入Flex Builder 3 的安装目录 将plugins目录下所有以 com.adobe 开头的文件或文件夹copy到上 ......

flex向子窗口传值(很简单的办法)

var login:infoChange=infoChange(PopUpManager.createPopUp( this, infoChange , true));
     login.x=250;
     login.y=150;
     login.userid.text=dg.selectedItem.aa;
     login.username.text=dg.selectedItem.bb;
  ......

FLEX 窗口居中

import flash.display.DisplayObject;
import mx.core.Application;
import mx.managers.PopUpManager;
var win:TestWindows= PopUpManager.createPopUp(DisplayObject(Application.application),TitleWindows,true) as TitleWindows;
PopUpManager.centerPopUp(win); ......

通过页面传递参数到flex中的几种方法

1.在<Object>和<embed>中设置flashVars参数,例如:
<object id=’mySwf’ classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ codebase=’http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab’ height=’100%’ width=’100%&rs ......

FLEX module的使用

用FLEX来开发应用难免不了要使用到Module,FLEX组件提供了ModuleLoader组件,该组件使用方式类似与swfLoader,但是通常仅仅使用该组件并不能满足我们的需求,这时FLEX为我们提供了ModuleManager,可以实现动态的载入不同的模块。
module分为两种,一种是完整的,一种是关联到主程序的,在新建Module时可以选择module swf s ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号