-------------------------------------------------------------------------------
<?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" minWidth="955" minHeight="600"
creationComplete="application1_creationCompleteHandler('application 分派')">
<s:layout>
<s:VerticalLayout/>
</s:layout>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
<fx:Model id="dateModel">
<data>
<a>aaaaaa</a>
<b>bbbbbbb</b>
<c>cccccc</c>
</data>
</fx:Model>
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
protected function application1_creationCompleteHandler(CreationCompText:String):void
{
// TODO Auto-generated method stub
var eventText:String=mainTextArea.text;
mainTextArea.text=eventText+CreationCompText+"\n";
/* 注销下面的在运行一次 */
dateModel.a="改变dataa数据"
}
]]>
</fx:Script>
<s:TextArea id="mainTextArea" width="205" height="241">
</s:TextArea>
<s:VGroup creationComplete="application1_creationCompleteHandler('group 分派')">
<s:Label creationComplete="application1_creationCompleteHandler('label 分派')">
</s:Label>
<s:Button id="button" label="{dateModel.a}" creationComplete="application1_creationCompleteHandler('button 分派')">
</s:Button>
</s:VGroup>
</s:Application>