这是一个恼人的错误,因为您无法取消DateChooser上的事件。这里有一个可能的解决方案:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
<mx:Script>
<![CDATA[
private function preventDateChooserBug(e:MouseEvent):void {
//set the mouseChildren property to false, not enabled because
//that could cause an irritating flickering when clicking the
//text input box for focus
dtc.mouseChildren = false;
//add the event listener to stage so we get the mouse up event even
//outside of the text input control
stage.addEventListener(MouseEvent.MOUSE_UP, function(e2:MouseEvent):void {
dtc.mouseChildren = true;
});
}
]]>
</mx:Script>
<mx:TextInput x="10" y="10" id="txt" mouseDown="preventDateChooserBug(event)" />
<mx:DateChooser x="178" y="10" id="dtc" />
</mx:Application>
太棒了!这解决了它,我学到了一些东西。谢谢! – cheetoResearch 2010-12-14 13:52:00