10 Replies Latest reply on Jan 28, 2013 11:37 AM by jbowden

    Jumping to a position based on another position

    Ayar2045 Level 1

      Hi,

       

      I have a symbol that plays on loop, one loop lasts 20 secs. As to my knowlege there isn't a "play x times faster" command (like there is play() or playReverse()), I have replicated the loop in a different section of the timeline but it is shortened to 5 seconds only. The point is that to close the symbol (which is a menu in my site) the symbol should get to its final position but in order to not having to wait 20 secs the timeline will jump to a position within the 5 secs animation proportional to the initial position.

       

      Loop from 0 to 20 secs. "Exit" animation from 20 secs to 25 secs.

       

      // I get the position

        var position=sym.getPosition();

       

      // Go to the new position based on 'position'.

        sym.play(20000+5000*(position/20000));

       

      This works fine in preview mode but as soon as I upload it to my server it doesn't work anymore, it simply jumps to 25000...