quint
December 12, 2016, 9:04pm
1
Assume Timeline A is 2 seconds long.
If I set the start point at the 2 second mark and play the timeline in reverse, is it possible in Javascript to specify a different duration (compress/extend timeline), either shorter or longer? Let's say I want Timeline A to complete playing in reverse in 1 second.
Cheers,
Quint
h_classen
(Hans-Gerd Claßen)
December 13, 2016, 11:00am
2
you may set up a additional relative timeline for this
quint
December 13, 2016, 5:41pm
3
Hello Hans,
Thanks for responding. I don’t understand what you suggested. I have attached a test file. Can you tell me what I did wrong?
Test.hype.zip (13.6 KB)
quint
December 14, 2016, 7:50pm
5
Thanks, Hans!!! Relative timelines and Custom Behaviors are two features I have yet to master. Again, thank you for your time!
petester
(Peter Borokhov)
December 21, 2017, 4:40pm
6
How do I increase the speed of reverse via javascript.
petester
(Peter Borokhov)
December 21, 2017, 6:03pm
8
h_classen
(Hans-Gerd Claßen)
December 21, 2017, 6:48pm
9
It is something under-the-hood …
petester
(Peter Borokhov)
December 22, 2017, 12:04am
10
Haha. What could it possibly mean?
h_classen
(Hans-Gerd Claßen)
December 22, 2017, 9:07am
11
well, it possibly means that the hypemethod is encapsulated and not reachable by its API.
quick’n dirty you can do for example a timelineaction that’ll reverse the timeline by a given factor:
var tl = event.timelineName, factor = 5, dur = hypeDocument.durationForTimelineNamed(tl);
var step = (dur/60)*factor;
hypeDocument.pauseTimelineNamed(tl);
function reverse() {
var cT = hypeDocument.currentTimeInTimelineNamed(tl);
var newTime = cT-step;
if(cT <= 0){
cancelAnimationFrame (reverser);
}else{
hypeDocument.goToTimeInTimelineNamed(newTime, tl);
var reverser = requestAnimationFrame(reverse);
}
}
reverse();
2 Likes
h_classen
(Hans-Gerd Claßen)
December 22, 2017, 9:37am
12
please notice that this method can cause other issues and should only be used for simple setups …
1 Like
petester
(Peter Borokhov)
December 23, 2017, 10:53pm
13
Brilliant! Thank you Hans .
petester
(Peter Borokhov)
December 24, 2017, 3:01am
14
The reverse works great! Though Like you said, It does come with some set backs and the thing I noticed it doesn't listen to other actions I set in place like continue timeline in the very beginning of the animation. It seems as though that reverse script takes control of the timeline for good.
Aperture.hype.zip (2.5 MB)