1、在flash builder 4.0中新建一个MXML应用程序;
2、在.mxml中增加如下的内容:
?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
????? xmlns:s="library://ns.adobe.com/flex/spark"
????? xmlns:mx="library://ns.adobe.com/flex/mx">
?<fx:Declarations>
??<fx:XMLList id="tree">
???<dataroots label="省市">
????<data label="北京市"/>
????<data label="辽宁省">
?????<subdata label="沈阳市" />
?????<subdata label="铁岭市"/>
?????<subdata label="大连市"/>
????</data>????????
???</dataroots>?
??</fx:XMLList>?
?</fx:Declarations>
?<mx:HDividedBox width="100%" height="100%">
??<s:Panel title="Panel1" width="35%" height="100%">
???<mx:Tree id="tree1" width="100%" height="100%"
????? dataProvider="{tree}" labelField="@label" showRoot="true"/>
??</s:Panel>
??<mx:VDividedBox width="65%" height="100%">
???<s:Panel title="Panel2" width="100%" height="40%">
????<s:TextArea text="This is VDividedBox Example!" width="100%" height="100%"/>
???</s:Panel>
???<s:Panel title="Panel3" width="100%" height="60%">
????<s:TextArea text="This is VDividedBox Example2!" width="100%"
???????height="100%"/>
???</s:Panel>?
??</mx:VDividedBox>
?</mx:HDividedBox>?
</s:Application>
4、编译后为如下效果
