DBear
April 5, 2016, 1:42pm
2
Here is a similar question asked recently. (Note: the search is your friend)
Possibly you could create a global variable that stores a value and check against this on layout load.
localStorage.fired = true; /// create this after the animation. (i.e at the end of the timeline)
then on layout load create the check
if (!localStorage.fired) {
hypeDocument.continueTimelineNamed('Main Timeline', hypeDocument.kDirectionForward) /// of course this will be whatever you've named you timeline
} else {
// do something on layout load if the animation has already played
}
NOTE …
You could perhaps adapt this to your needs.
Another route would be to pause and store the time in the timeline that is playing (on layout / scene unload ) and then continue the timeline from the stored information (on scene / layout load )
If you wanted to synchronize timelines across layouts, you could use this code on layout load:
var timelineNames = ["Main Timeline"];
for(var i = 0; i < timelineNames.length; i++) {
var timelineName = timelineNames[i];
var timelineKey = "timeline_" + hypeDocument.currentSceneName() + "_" + timelineName;
var timelineInfo = window[timelineKey];
if(timelineInfo != null) {
hypeDocument.goToTimeInTimelineNamed(timelineInfo["time"], timelineName);
if(timelineInfo["state"] == tru…
2 Likes