on Jun 21, 2014 at 9:28:56 pm Last Edited By Benoit Kergosien on Jun 21, 2014 at 10:23:38 pm
despite a hunt of expressions in the forum ( thank you dear Dan Ebberts)
I can't achieve to access the duration of a value.
The short story:
My SQUARE is moving withtwo arrows on left and right side, i want their animations switch to on when the SQUARE moves in their direction
and when it changes in the opposite the arrows scale down in 2 seconds and the opposite arrow switch to on,etc...
No doubts that many parts of my following process is unificient so please correct me.
The long story:
A SQUARE is animated with a wiggle:
For the direction, I think you just need to monitor the x component of the square layer's velocity:
if it's positive, the square is/was moving to the right, negative to the left.
From there it gets complicated, even if you make the simplifying assumption that the scale-up and scale-down animations are never triggered while the other animation is in progress. You need a more complicated threshold detector that starts at the current frame and goes backwards to find the most recent threshold crossing (in either direction). Whether it was a positive-to-negative or negative-to-positive transition determines whether you run the scale-up or scale-down animation (you would do the opposite for the other arrow).