MXML のみを使用して、要素を追加および削除する状態間を遷移する簡単な方法はありますか。
例えば:
<s:Group includeIn="state1"/>
<s:Group includeIn="state2"/>
たとえば、MXML トランジションで state1 をスライドさせて state2 をスライドさせることはできますか?
ありがとうございました。
MXML のみを使用して、要素を追加および削除する状態間を遷移する簡単な方法はありますか。
例えば:
<s:Group includeIn="state1"/>
<s:Group includeIn="state2"/>
たとえば、MXML トランジションで state1 をスライドさせて state2 をスライドさせることはできますか?
ありがとうございました。
上記のリンクに加えて、単一のトランジションを複数のターゲットに適用する方法を次に示します。
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:views="views.*" >
<s:states>
<s:State name="home"/>
<s:State name="help"/>
<s:State name="instructions"/>
<s:State name="settings"/>
<s:State name="feedback"/>
</s:states>
<s:transitions>
<s:Transition fromState="*" toState="*" >
<s:Sequence >
<s:Wipe direction="right" duration="350" target="{this}"/>
</s:Sequence>
</s:Transition>
</s:transitions>
<views:Home id="home" includeIn="home" width="100%" height="100%" ownerComponent="{this}"/>
<views:Help id="help" includeIn="help" width="100%" height="100%" ownerComponent="{this}" />
<views:Instructions id="instructions" includeIn="instructions" width="100%" height="100%" ownerComponent="{this}" />
<views:Settings id="settings" includeIn="settings" width="100%" height="100%" ownerComponent="{this}" />
<views:Feedback id="feedback" includeIn="feedback" width="100%" height="100%" ownerComponent="{this}" />
</s:Group>
前のトランジションは、ある方向から別の方向へのワイプを作成します。
次のトランジションは、あるビューから別のビューにフェードします。
<s:transitions>
<s:Transition fromState="*" toState="home" >
<s:Sequence >
<s:Fade target="{this}" alphaFrom="1" alphaTo="0"/>
<s:RemoveAction targets="{[home,help,instructions,settings,feedback]}"/>
<s:AddAction target="{home}"/>
<s:Fade target="{this}" alphaFrom="0" alphaTo="1"/>
</s:Sequence>
</s:Transition>
</s:transitions>
次は、1 つのビューをスライド インし、残りをスライド アウトします。
<s:transitions>
<s:Transition fromState="*" toState="home" >
<s:Sequence duration="1000" >
<s:Parallel>
<s:Move applyChangesPostLayout="true" targets="{notHomeTargets}" xFrom="0" xTo="{-width}"/>
<s:AddAction target="{home}" />
<s:Move applyChangesPostLayout="true" target="{home}" xFrom="{width}" xTo="0"/>
</s:Parallel>
<s:RemoveAction targets="{targets}" />
</s:Sequence>
</s:Transition>
</s:transitions>
最後の例では、州ごとに 1 つ作成する必要があります。