I've built a Hype document with multiple scenes that runs inside an application called iPresent.
The document contains links to external websites. When the user returns to the Hype document after clicking on one of those links, the Hype document reloads and the initial screen is presented.
I'd like to alter that behavior, so that the user returns to the Hype document at the scene they last visited.
--
Here's what I tried, based on previous posts to this incredibly helpful forum, which for some reason didn't work. Wondering if I'm missing something simple.
On the home scene, called "Home":
if (localStorage.scene) { // if there is a variable stored (returns true)
hypeDocument.showSceneNamed(localStorage.scene, hypeDocument.kSceneTransitionInstant)
} else { // if there is nothing stored you can do something here.
}
On a screen with external links:
localStorage.scene = hypeDocument.currentSceneName();
On the close button for a screen with external links, to reset the counter:
localStorage.clear();
hypeDocument.showSceneNamed('Home', hypeDocument.kSceneTransitionCrossfade, 1.1)
Any suggestions? Thanks in advance.