Change Scene from external javascript

You most certainly can also use Global Behavior an extension and invoke
HypeGlobalBehavior.triggerCustomBehaviorNamed('nextScene'); and then listen to '#nextScene' to fire the action.

But actually the HYPE.documents['your_document_name'].showSceneNamed('scene2'); should work… I am guessing you got the document name wrong. You can get the name when looking into the console and inspecting HYPE.documents on your preview just type Object.keys(HYPE.documents) OR by running alert(hypeDocument.documentName()); from anywhere inside your Hype document functions.

If you are sure you got the name right then the scope of your callback could be the issue. Meaning that this is not a synonym for window and then you would need to use window.HYPE.documents['your_document_name'].showSceneNamed('scene2');