Hello to everyone,
I’m new to Hype,
How do I get to the screen name of all the symbols on the stage?
[Symbol4, SymbolA, Symbol] Like this,
Is there any method or function that returns an array?
I apologize for english use google translation
Hello to everyone,
I’m new to Hype,
How do I get to the screen name of all the symbols on the stage?
[Symbol4, SymbolA, Symbol] Like this,
Is there any method or function that returns an array?
I apologize for english use google translation
Maybe something like this in the head.
<script>
window.symbolNames = []
function myCallback(hypeDocument, element, event) {
window.symbolNames.push(hypeDocument.getSymbolInstanceById(element.id).symbolName())
return true;
}
if("HYPE_eventListeners" in window === false) {
window.HYPE_eventListeners = Array();
}
window.HYPE_eventListeners.push({"type":"HypeSymbolLoad", "callback":myCallback});
</script>
Thank you MarkHunte.
it works.
Clever idea using the HypeSymbolLoad
callback! My solution required using a classname then looking up from classname -> element id -> symbol instance -> symbol name.