3 Replies Latest reply on Jan 15, 2011 12:13 PM by C.CRIder

    How to loop action sequence?

    C.CRIder Level 1

      I am trying to loop a simple 5 picture action sequence so that it will constantly be playing. I have tried using builder 4 to add "effectEnd="SequenceX.play()" to the Parallel tag but it doesn't change anything... here is what my Main.mxml looks like after I added the "effectEnd"

       

      <fx:Declarations>
              <s:Parallel id="Sequence1" effectEnd="Sequence1.play()">
                  <s:Parallel target="{group1}">
                      <s:Fade alphaTo="0" duration="3000"/>
                  </s:Parallel>
                  <s:Parallel target="{group2}">
                      <s:Fade alphaTo="0" duration="3000" startDelay="3000"/>
                  </s:Parallel>
                  <s:Parallel target="{group3}">
                      <s:Fade alphaTo="0" duration="3000" startDelay="6000"/>
                  </s:Parallel>
                  <s:Parallel target="{group4}">
                      <s:Fade alphaTo="0" duration="3000" startDelay="9000"/>
                  </s:Parallel>
                  <s:Parallel target="{group5}">
                      <s:Fade alphaTo="0" duration="3000" startDelay="12000"/>
                  </s:Parallel>
              </s:Parallel>
          </fx:Declarations>

       


      Can someone tell me what I'm doing wrong, and/or the easiest way to make these 5 pics (action sequence) loop. Also, I create every thing in catalyst, so nothing was imported.

       

      Thanks!

        • 1. Re: How to loop action sequence?
          C.CRIder Level 1

          Any help? In a pinch...

          • 2. Re: How to loop action sequence?
            Chris W. Griffith Adobe Community Professional

            Here is basic outline of what you need to do:

            Trigger the fade outs - I did this on application start

            Once all 5 have finished their transitions, call a function that will fade the images back in

            Once the images have faded back in, call the function that fades them out.

             

            Here is the MXML (important parts in bold):

             

            <?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"

               creationComplete="init()"

               >

            <s:layout>

            <s:TileLayout/>

            </s:layout>

            <fx:Script>

            <![CDATA[

            protected function init():void

            {

              fadesStart();

            }

             

            protected function fadesStart():void

            {

               fadeAway.play();

            }

             

            protected function fadesDone():void

            {

              fadeIn.play();

            }

            ]]>

            </fx:Script>

            <fx:Declarations>

            <s:Parallel id="fadeAway" effectEnd="fadesDone()">

            <s:Parallel target="{group1}">

            <s:Fade alphaTo="0" duration="3000"/>

            </s:Parallel>

            <s:Parallel target="{group2}">

            <s:Fade alphaTo="0" duration="3000" startDelay="3000"/>

            </s:Parallel>

            <s:Parallel target="{group3}">

            <s:Fade alphaTo="0" duration="3000" startDelay="6000"/>

            </s:Parallel>

            <s:Parallel target="{group4}">

            <s:Fade alphaTo="0" duration="3000" startDelay="9000"/>

            </s:Parallel>

            <s:Parallel target="{group5}">

            <s:Fade alphaTo="0" duration="3000" startDelay="12000"/>

            </s:Parallel>

            </s:Parallel>

             

            <s:Parallel id="fadeIn" effectEnd="fadesStart()">

            <s:Parallel target="{group1}">

            <s:Fade alphaTo="1" duration="3000"/>

            </s:Parallel>

            <s:Parallel target="{group2}">

            <s:Fade alphaTo="1" duration="3000" startDelay="3000"/>

            </s:Parallel>

            <s:Parallel target="{group3}">

            <s:Fade alphaTo="1" duration="3000" startDelay="6000"/>

            </s:Parallel>

            <s:Parallel target="{group4}">

            <s:Fade alphaTo="1" duration="3000" startDelay="9000"/>

            </s:Parallel>

            <s:Parallel target="{group5}">

            <s:Fade alphaTo="1" duration="3000" startDelay="12000"/>

            </s:Parallel>

            </s:Parallel>

            </fx:Declarations>

            <s:Image source="assets/images/Picture 1.png" width="200" height="150" id="group1" />

            <s:Image source="assets/images/Picture 2.png" width="200" height="150" id="group2" />

            <s:Image source="assets/images/Picture 3.png" width="200" height="150" id="group3" />

            <s:Image source="assets/images/Picture 4.png" width="200" height="150" id="group4" />

            <s:Image source="assets/images/Picture 5.png" width="200" height="150" id="group5" />

            </s:Application>

             

            I have attached a sample FXP (Burrito-Based)

            • 3. Re: How to loop action sequence?
              C.CRIder Level 1

              Thanks Chris! I will try this and let you know what happens!