<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
private function button_click(evt:MouseEvent):void {
appendText(evt.type);
}
private function button_doubleClick(evt:MouseEvent):void {
appendText(evt.type);
}
private function appendText(str:String):void {
var now:Date = new Date();
textArea.text += "[" + now.toTimeString() + "] " + str + "\n";
textArea.validateNow();
textArea.verticalScrollPosition = textArea.maxVerticalScrollPosition;
}
]]>
</mx:Script>
<mx:ApplicationControlBar dock="true">
<mx:Form styleName="plain">
<mx:FormItem label="doubleClickEnabled:">
<mx:CheckBox id="checkBox"
selected="true" />
</mx:FormItem>
<mx:FormItem>
<mx:Button id="button"
label="[double] click me"
doubleClickEnabled="{checkBox.selected}"
click="button_click(event);"
doubleClick="button_doubleClick(event);" />
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>
<mx:TextArea id="textArea"
editable="false"
width="50%"
height="100%" />
</mx:Application>