Hello!
I have created many website-like projects in Tumult Hype, and to learn Saola Animate, I was trying to replicate most of my projects. So, I stembled upon this. In Hype, I could run a JS fucntion onSceneLoad
to set the URL in address bar. It would allow me to link to a specific scene externally as each scene now had its own URL and also, it could allow users to use the brower navigation (Back, Forward, Refresh). Thus, all I had to do was set distinct Scene Names without spaces and I had got a complete website-like project. This is the script:
var checkHash = function()
{
var hash = window.location.hash.substring(1);
for(var i = 0; i < hypeDocument.sceneNames().length; i++)
{
if(hypeDocument.sceneNames()[i] == hash)
{
hypeDocument.showSceneNamed(hash);
break;
}
}
};
if (window.loadedHashLocation != true)
{
window.loadedHashLocation = true;
checkHash();
window.onhashchange = checkHash;
}
window.location.hash = "#" + hypeDocument.currentSceneName();
}
Well, it seems like it can be reproduced in Saola Animate too, but, I got stuck at line 3: hypeDocument.sceneNames()
. The hypeDocument.sceneNames()
returns the names of all the scenes in the document as an array. I couldn’t find a similar API in Saola. I found the getSceneCount
one. Other than that, I guess, all other Hype APIs from the above code are available in Saola.
Now, I read on the forum that I can set a Start Scene parameter in the document initialization code in the HTML5 output, but, it’s not really practical. Firstly, I’d have to create an individual page for each scene. Secondly, I won’t be able to use scene transitions. Thirdly and probably lastly, I’d have to hard-code links in my document, as opposed to switching scenes, so, it will create problems in previewing.
I’d thus like to request Atomi team to consider including this API to their already long list in a future release.