flex简单翻转问题

时间:2011-07-23 10:54:21

标签: flex flex3 flex4

我在panel1里面有一个panel2。 当我翻转panel1时,我希望panel2可见,当mouseOut,panel2不可见时。 使用mouseOcer和MouseOut事件很简单

当然,当我翻转panel2(在panel1内)时出现问题:它开始闪烁。 我的问题是:如何简单地纠正它? (当然我希望panel2里面的按钮也是活动的)

问候

1 个答案:

答案 0 :(得分: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>