If you are putting this in an iframe context and know there will only be a single animation, then I’d probably recommend just using the HypeDocumentLoad listener in the first link@Daniel sent, since this will send a hypeDocument object. This way you don’t need to worry about the export name at all. (And you can’t call the document until the HypeDocumentLoad event anyways!)
<script>
function myCallback(hypeDocument, element, event) {
// store as some global you know about and can access later
window.myHypeDocument = hypeDocument;
}
if("HYPE_eventListeners" in window === false) {
window.HYPE_eventListeners = Array();
}
window.HYPE_eventListeners.push({"type":"HypeDocumentLoad", "callback":myCallback});
</script>
I suppose alternatively there will only be the one entry in HYPE.documents.