2011-07-23 36 views
0

我在panel1內有一個panel2。 當我翻轉panel1時,我希望panel2可見,並且當mouseOut,panel2不可見時。 這是簡單的mouseOcer和MouseOut事件flex簡單的翻轉問題

當然,麻煩是當我翻轉panel2(內部panel1):它開始閃爍。 我的問題是:如何簡單地糾正它? (當然,我想裏面是Panel2按鈕是活躍的爲好)

問候

回答

0

爲什麼這個代碼將不會爲你工作?

<?xml version="1.0" encoding="utf-8"?> 
<s:Application minHeight="600" minWidth="955" xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"> 
    <fx:Script> 
    <![CDATA[ 
     [Bindable] 
     private var isOver:Boolean; 
    ]]> 
    </fx:Script> 
    <s:Panel horizontalCenter="0" id="panel1" mouseOut="isOver = false" mouseOver="isOver = true" title="Panel1" 
     verticalCenter="0"> 
     <s:Panel bottom="10" id="panel2" left="10" right="10" title="Panel2" top="10" visible="{isOver}"> 
      <s:layout> 
       <s:VerticalLayout horizontalAlign="center" paddingBottom="10" paddingLeft="10" paddingRight="10" 
        paddingTop="10" verticalAlign="middle" /> 
      </s:layout> 
      <s:Label id="actionResult" /> 
      <s:HGroup> 
       <s:Button click="actionResult.text = 'Button 1 clicked'" label="Button1" /> 
       <s:Button click="actionResult.text = 'Button 2 clicked'" label="Button2" /> 
      </s:HGroup> 
     </s:Panel> 
    </s:Panel> 
</s:Application>