【问题标题】:flex transition effects works on 2nd and after transition, but not on very first transitionflex 过渡效果适用于第二次和过渡后,但不适用于第一次过渡
【发布时间】:2010-05-18 23:29:07
【问题描述】:

我有一个 flex 应用程序,可以通过按钮切换在两种状态之间转换。我的问题是,褪色的效果似乎只在第二次过渡和之后起作用。但是,对于我的第一次过渡...从 State1 到 studyState... 没有任何淡入淡出效果,实际上 state1 中的组件完全消失(页脚填充了“body”曾经所在的空白间隙)然后flex 重新创建了 studyState(没有任何淡入淡出,仅在 studyState 中使用组件重新填充“body”)。

然而,在第一次转换之后,在 studyState 和 State1 之间运行完全正常.. 为什么会发生这种情况,我怎样才能使它从第一次转换开始交叉淡入淡出工作?请帮忙!

 <s:transitions>
 <s:Transition id="t1" autoReverse="true">
 <s:CrossFade
  target="{holder}" 
  duration="1500" />
 </s:Transition>
 </s:transitions>
 <s:states>
 <s:State name="State1" />
 <s:State name="studyState" />
 </s:states>

<s:VGroup id="globalGroup" includeIn="State1" width="100%">stuff</Vgroup>
<s:VGroup id="studyGroup" includeIn="studyState" width="100%">stuff</Vgroup>

【问题讨论】:

    标签: apache-flex flexbuilder flash-builder transitions


    【解决方案1】:

    状态转换有什么问题?你能提供一个完整的代码示例吗?

    这个代码段基本上可以按我的预期工作:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    
    <s:transitions>
        <s:Transition id="t1" autoReverse="true">
            <s:CrossFade
                target="{this}" 
                duration="1500" />
        </s:Transition>
    </s:transitions>
    <s:states>
        <s:State name="State1" />
        <s:State name="studyState" />
    </s:states>
    
    <s:VGroup id="globalGroup" includeIn="State1" width="100%">
        <s:Button label="State1 to studyState" click="this.currentState = 'studyState'" />
    </s:VGroup>
    <s:VGroup id="studyGroup" includeIn="studyState" width="100%">
        <s:Button label="studyState to State1" click="this.currentState = 'State1'"  />
    </s:VGroup>
    
    
    </s:Application>
    

    【讨论】:

    • 嘿,flextras,实际上看起来错误来自使用生命周期协作服务 (LCCS) 框架中的自定义 SessionConnectContainer 标记。一旦我使用了“无头”容器,一切都很好!感谢您的帮助!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-12
    • 2013-09-04
    • 1970-01-01
    • 1970-01-01
    • 2021-01-29
    • 1970-01-01
    相关资源
    最近更新 更多