poyser7
(J S Poyser)
October 10, 2016, 10:53am
1
Hi there, Ive seen lots of discussions about looping timelines and the only method I have found is to place 2 actions in the timeline.
1st Action, include Javascript to loop 3 times-
if (window.loopCount == null) {
window.loopCount = 0;
}
if (window.loopCount < 2) {
window.loopCount++;
hypeDocument.startTimelineNamed('Main Timeline', hypeDocument.kDirectionForward);
}
2nd Action, include javascript to stop at a specific point-
hypeDocument.pauseTimelineNamed(‘Main Timeline’);
This works fine if you want it to stop beyond the point of the last loop.
Is there a way to enable it to stop before the end of the last loop?
Many thanks
1 Like
DBear
October 10, 2016, 12:44pm
2
Yes. Place a timeline action where you want it to pause and run a Javascript->New Function that checks the condition of the loop count for example if window.loopCount == 1
then pause the timeline.
if (window.loopCount == 1) {
hypeDocument.pauseTimelineNamed('Main Timeline');
}
The number used is dependent on how many loops you have
1 Like
poyser7
(J S Poyser)
October 10, 2016, 1:49pm
3
DBear, thank you very much for that. I can now save as a template and create some cool ads.
Nice one!
honeywood
(Ready steady)
October 17, 2019, 4:32pm
4
300x250_Casino_10CADFORUm.hype.zip (59.3 KB)
I am trying to do the same thing, but struggling. I have made the banner loop x3 times, but I want it to end on around 8 seconds. Could anyone help?
h_classen
(Hans-Gerd Claßen)
October 17, 2019, 5:49pm
5
2 Likes
honeywood
(Ready steady)
October 17, 2019, 8:42pm
6
Easy when you know how! thank you very much
Legend!!