flex tree默认展开第一个节点
<?xml version="1.0" encoding="utf-8"?>
<mx:Application fontSize="12" xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
<mx:Script>
<![CDATA[
public var treeXml: XML = <nodes name="所有">
<node name="test01" code ="01" >
<node name="test0101" code ="0101" />
<node name="test0102" code ="0102" />
<node name="test0103" code ="0103" />
</node>
<node name="test02" code ="02" />
<node name="test03" code ="03" />
<node name="test04" code ="04" >
<node name="test0401" code ="0401" />
<node name="test0402" code ="0402" />
<node name="test0403" code ="0403" />
</node>
<node name="test05" code ="05" />
</nodes>;
private function init():void
{
tree.dataProvider = treeXml;
//默认展开第一个节点
tree.openItems = treeXml;
}
]]
相关文档:
1、arraycollection转化为xml,代码如下:
//动态生成树形结构
public static function flatArrayToXML(arr:Object,rootname:String=null,nodename:String=null, outputString:Boolean=false):Object{
if (arr is Array){
......
在Flex里,一般的弹出窗口(除了Alert以外)都可以用TitleWindow组件完成,主窗口和TitleWindow的数据传输可以用以下方法:
假设TitleWindow的实例文件为titleWin.mxml,则要在Application中用PopUpManager创建一个titleWin的引用
private var popWin:titleWin = titleWin(PopUpManager.createPopUp(this,titleWin,true)) ......
三年前,用过AmfPHP与Flash/Flex
Remoting做过交互,最近接触Python,公司项目用的Flex做前端,所以接触了PyAmf。PyAmf本质上跟AmfPHP是雷同的。都是通
过对AMF协议(ActionScript Message Format)协议的支持来实现对Flash的交互过程。
一、首先,简单的介绍一下AMF协议格式。
AMF是Adobe独家开发出来的通信协议,它采 ......
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Panel width="392" height="300" layout="absolute">
<mx:Label x="19" y="10" text="{user}" width="171" height="20"/>
<mx ......
今天做Flex时碰到flex和java交互的乱码问题,使用HTTPService无论是从Flex端传到Java端,还是反过来都乱码。调查了半天,终于搞定了。
以下是解决方案:
1.Flex端传到Java端
Flex端:encodeURIComponent(comment.text)
使用encodeURIComponent把参数转换为 application/x-www ......