2 Replies Latest reply on Dec 12, 2014 6:02 AM by bijupetL11

    Play a specific part of a timeline

    bijupetL11

      I found this topic which is really close:

      Play a specific part of a timeline

       

      I have 4 objects sitting in a circle. Similar to a compass. When I click on one of the objects, it should move in a circular path to the topmost position (north). It can go clockwise or counter-clockwise (whichever is closer) in order to get to the north position.

       

      I was using labels and can use play("symbol_name") to start at the right time. but if I follow that command with stop(X) where X is a point on the timeline, it immediately jumps to that point instead of traveling the timeline to get there. It basically ignores the circular animation and jumps to the final destination.

       

      I can't put stop() on the timeline as a trigger because an object may need to pass over it. For example, I want to move object 1 from point A to D (skipping B and C). If I had stop() triggers at B and C, I could never get the animation to play from A-D.

       

      BTW the objects are grouped together as a symbol and so when I click one of the objects, I am actually rotating the parent and then rotating its children the same amount in the opposite direction.

       

      Any suggestions? Thanks.

        • 1. Re: Play a specific part of a timeline
          vivekuma Adobe Employee

          You have to put stop on the timeline as a trigger for all label position A, B, C & D.

          But along with that have code something like below:

               for label B:

                    if(sym.bPassB) {

                         sym.play();

                    }

           

          Similarly for other label positions as well.

           

          So, better create 4 such flags like bPassA, bPassB, bPassC, bPassD, in the compositionReady event hanlder for the stage and set all to false like:

               sym.bPassA = sym.bPassB = sym.bPassC = sym.bPassD = false;

           

          and then control these flag to decide whether to pass those 4 objects or not.

           

          hth,

          Vivekuma

          • 2. Re: Play a specific part of a timeline
            bijupetL11 Level 1

            Thanks Vivekuma,

            I have uploaded the project here:

            edge3.zip - Google Drive

             

            Only the clock, people and the monitor icons have click behaviors now. As a reminder,  the goal is that when I click on an icon, I want it to rotate to the north position (choosing clockwise or counter-clockwise depending on which is the shortest route).

             

            It's working on the first click with the monitor icon (by first click I mean after a screen refresh). But on first click with the clock where I am using playReverse, it plays to the next trigger and then and then does a play (not reverse). I think that is because it gets to the trigger and then I am issuing a play command instead of continuing the existing playReverse command. So instead of a play command at each trigger, I guess what I need is a "continue" action that just allows it to keep going. Is there such a thing?

             

            Also, notice this: refresh, click the monitor and then click the monitor again. The first click should take it to the north position. Clicking again should just stay there but instead it goes to the home position.

             

            Lastly, is there a way to render a type string on the page that just shows the current position (time and label)? Thanks,

            Mat