<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button x="144" y="190" label="Button">
<mx:click>
<![CDATA[
import mx.controls.Alert;
Alert.show("click");
]]>
</mx:click>
<mx:focusOut>
<![CDATA[
import mx.controls.Alert;
Alert.show("focusOut");
]]>
</mx:focusOut>
</mx:Button>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Button x="144" y="190" label="Button">
<mx:click>
<![CDATA[
import mx.controls.Alert;
Alert.show("click");
]]>
</mx:click>
<mx:focusOut>
<![CDATA[
import mx.controls.Alert;
Alert.show("focusOut");
]]>
</mx:focusOut>
</mx:Button>
</mx:Application>
对优化代码很有好处 建议使用这样的写法
不然代码多了 找事件也难找
同时更利于界面有代码分离