Adobe Animate Canvas generates content and I attach that content in iframe. Then canvas is drawn and various script variables are created in iframes document.
I need to access variable 'stage' that is generated when iframe of adobe animation is loaded fully.
What I have to do now - to attach setTimeout and then it seem to be accessable. If I do not attach timeout, console throws error.
What I want to achieve - I want to avoid setTimeout and refactor code in better way.
I have tried jquery:
$element.on( 'load', function() {
// Gives error when accessing the stage property
$element[0].contentWindow.stage
// allows to access stage property
setTimeout(() => {
console.log($element[0].contentWindow.stage)
}, 1000)
});