您可以使用 Fade 指定所有元素进行转换,而不单独列出吗?

发布于 2024-11-10 07:59:13 字数 1891 浏览 3 评论 0原文

我已经开始了一个空气应用程序,我正在尝试使用淡入淡出(理论上应该淡出,然后淡入下一个状态的序列)在状态之间进行转换。有没有一种方法可以定位它淡出所有元素,还是需要使用 Target="..." 并列出每个元素?

我尝试过将所有元素嵌套在一个组中,但这似乎不起作用。

我当前代码的缩短版本:

<s:states>
    <s:State name="HomeScreen"/>
    <s:State name="EnemyBuilder"/>
    <s:State name="EncyclopediaBuilder"/>
</s:states>
<fx:Declarations>
    <s:Transition toState="*" fromState="*" >
        <s:Sequence >
            <s:Fade alphaFrom="1" alphaTo="0" duration="250" target="{wrapper}" />
            <s:Fade alphaFrom="0" alphaTo="1" duration="250" target="{wrapper}" />
        </s:Sequence>
    </s:Transition> 
</fx:Declarations>

<s:Group id="wrapper" includeIn="HomeScreen, EnemyBuilder, EncyclopediaBuilder" >

<s:BorderContainer id="encounter" includeIn="HomeScreen" 
                   x="49" y="99" width="200" height="44" 
                   styleName="falseButton"
                   rollOut="alphaOver(event)" rollOver="alphaOver(event)" click="currentState='EncyclopediaBuilder'" >
    <s:Label x="48" y="8" color="#000000" fontFamily="Arial" text="Create a new encounter" />
    <s:Label x="48" y="24" color="#000000" fontStyle="italic" text="Single encounter" />
    <s:Image x="10" y="10" source="assets/001_01.png" />
<s:BorderContainer id="back" includeIn="EncyclopediaBuilder" 
                   right="20" bottom="20" width="200" height="44"
                   styleName="falseButton"
                   rollOut="alphaOver(event)" rollOver="alphaOver(event)"
                   click="currentState='HomeScreen'" >
    <s:Label x="48" y="16" color="#000000" fontFamily="Arial" text="Save and Return"/>
    <s:Image x="10" y="10" source="assets/001_01.png"/>
</s:BorderContainer>        
</s:BorderContainer></s:Group>  

I've got the beginning of an air app, and I'm trying to transition between the states using Fade (a Sequence that should, in theory, fade out, then fade the next state in.) Is there a way to target it to fade out ALL the elements, or will I need to use targets="..." and list every element?

I've tried nesting all the elements in a Group, but that isn't seeming to work.

Shortened version of my current code:

<s:states>
    <s:State name="HomeScreen"/>
    <s:State name="EnemyBuilder"/>
    <s:State name="EncyclopediaBuilder"/>
</s:states>
<fx:Declarations>
    <s:Transition toState="*" fromState="*" >
        <s:Sequence >
            <s:Fade alphaFrom="1" alphaTo="0" duration="250" target="{wrapper}" />
            <s:Fade alphaFrom="0" alphaTo="1" duration="250" target="{wrapper}" />
        </s:Sequence>
    </s:Transition> 
</fx:Declarations>

<s:Group id="wrapper" includeIn="HomeScreen, EnemyBuilder, EncyclopediaBuilder" >

<s:BorderContainer id="encounter" includeIn="HomeScreen" 
                   x="49" y="99" width="200" height="44" 
                   styleName="falseButton"
                   rollOut="alphaOver(event)" rollOver="alphaOver(event)" click="currentState='EncyclopediaBuilder'" >
    <s:Label x="48" y="8" color="#000000" fontFamily="Arial" text="Create a new encounter" />
    <s:Label x="48" y="24" color="#000000" fontStyle="italic" text="Single encounter" />
    <s:Image x="10" y="10" source="assets/001_01.png" />
<s:BorderContainer id="back" includeIn="EncyclopediaBuilder" 
                   right="20" bottom="20" width="200" height="44"
                   styleName="falseButton"
                   rollOut="alphaOver(event)" rollOver="alphaOver(event)"
                   click="currentState='HomeScreen'" >
    <s:Label x="48" y="16" color="#000000" fontFamily="Arial" text="Save and Return"/>
    <s:Image x="10" y="10" source="assets/001_01.png"/>
</s:BorderContainer>        
</s:BorderContainer></s:Group>  

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苹果你个爱泡泡 2024-11-17 07:59:13

尝试使用类似以下内容:

<s:states>
    <s:State name="HomeScreen"/>
    <s:State name="EnemyBuilder"/>
    <s:State name="EncyclopediaBuilder"/>
</s:states>
<s:transitions>
    <s:Transition toState="*" fromState="*" >
        <s:Sequence target="{wrapper}">
            <s:Fade alphaFrom="1" alphaTo="0" duration="250" />
            <s:Fade alphaFrom="0" alphaTo="1" duration="250" />
        </s:Sequence>
    </s:Transition> 
</s:transitions>

<s:Group id="wrapper">

<s:BorderContainer id="encounter" includeIn="HomeScreen" 
                   x="49" y="99" width="200" height="44" 
                   styleName="falseButton"
                   rollOut="alphaOver(event)" rollOver="alphaOver(event)" click="currentState='EncyclopediaBuilder'" >
    <s:Label x="48" y="8" color="#000000" fontFamily="Arial" text="Create a new encounter" />
    <s:Label x="48" y="24" color="#000000" fontStyle="italic" text="Single encounter" />
    <s:Image x="10" y="10" source="assets/001_01.png" />
<s:BorderContainer id="back" includeIn="EncyclopediaBuilder" 
                   right="20" bottom="20" width="200" height="44"
                   styleName="falseButton"
                   rollOut="alphaOver(event)" rollOver="alphaOver(event)"
                   click="currentState='HomeScreen'" >
    <s:Label x="48" y="16" color="#000000" fontFamily="Arial" text="Save and Return"/>
    <s:Image x="10" y="10" source="assets/001_01.png"/>
</s:BorderContainer>        
</s:BorderContainer></s:Group>  

Try to use something like the following:

<s:states>
    <s:State name="HomeScreen"/>
    <s:State name="EnemyBuilder"/>
    <s:State name="EncyclopediaBuilder"/>
</s:states>
<s:transitions>
    <s:Transition toState="*" fromState="*" >
        <s:Sequence target="{wrapper}">
            <s:Fade alphaFrom="1" alphaTo="0" duration="250" />
            <s:Fade alphaFrom="0" alphaTo="1" duration="250" />
        </s:Sequence>
    </s:Transition> 
</s:transitions>

<s:Group id="wrapper">

<s:BorderContainer id="encounter" includeIn="HomeScreen" 
                   x="49" y="99" width="200" height="44" 
                   styleName="falseButton"
                   rollOut="alphaOver(event)" rollOver="alphaOver(event)" click="currentState='EncyclopediaBuilder'" >
    <s:Label x="48" y="8" color="#000000" fontFamily="Arial" text="Create a new encounter" />
    <s:Label x="48" y="24" color="#000000" fontStyle="italic" text="Single encounter" />
    <s:Image x="10" y="10" source="assets/001_01.png" />
<s:BorderContainer id="back" includeIn="EncyclopediaBuilder" 
                   right="20" bottom="20" width="200" height="44"
                   styleName="falseButton"
                   rollOut="alphaOver(event)" rollOver="alphaOver(event)"
                   click="currentState='HomeScreen'" >
    <s:Label x="48" y="16" color="#000000" fontFamily="Arial" text="Save and Return"/>
    <s:Image x="10" y="10" source="assets/001_01.png"/>
</s:BorderContainer>        
</s:BorderContainer></s:Group>  
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文