我在MXML中構建了一個具有不同狀態的圖形組件,每個狀態都有其自己的大小。mouseOver和mouseOut改變大小畫布
我有一個「正常」狀態和一個「強調狀態」時,突出顯示的一個具有較高的高度。
在此分量I實現的功能,以在每個的mouseOver及移出時執行,以從正常狀態到突出顯示的狀態,返回改變。
我的問題是,在高亮模式下,根據正常狀態的尺寸被觸發mouseout事件。
下面是代碼:
<mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:controller="com.*"
mouseOver="mouseOverHandler(event)" mouseOut="mouseOutHandler(event)"
width="230" height.Playing="40" height.Normal="21" height.Highlighted="40">
<mx:states>
<mx:State name="Normal" />
<mx:State name="Playing" />
<mx:State name="Highlighted" />
</mx:states>
<mx:Button includeIn="Highlighted" left="19" bottom="2" width="15" height="15" />
</mx:Canvas>
有什麼錯在我使用mouseOuver及移出的方式嗎?
感謝,
亞歷山大
我已經找到另一個問題的解決方案:http://stackoverflow.com/questions/557028/how-to-stop-mouse-out-event-on-flex-canvas-firing-for-child-elements – Alexandre 2011-06-08 12:47:29