Here is how the Noteflight API is trying to access the score in the iFrame:
var frame = document.getElementById('score1'); // find the DOM element for our iframe
var score1 = new NFClient.ScoreView(frame); // construct a ScoreView object
score1.addEventListener('editorReady', handleEditorReady); // wait for ready event
s.playFromMeasure(1);
I know Hype only can access elements via: hypeDocument.getElementById
Hi -
Here is a quick follow up question: I’m unable to reposition the resulting Noteflight score. Regardless of where I position the the Rectangle with the ID ‘score1’ the score is always positioned in the upper left corner.
How would I reposition it?
That did not make sense to me until I tried to mover the Rectangle over to the Right and half of scene.
It does not move and the Score stays in the scene as though no change has happened.
The score1 div is being controlled by css from the noteflight API. So your work around works as you tell it to go left after it has displayed.
If I get a chance I will look at this further to see if there is any other way to control it
So another way to control the position is the select the Score1 Rectangle and place it in a Group.
The Rectangle will reference it’s origins in relation to the Group so you can the visually place the Group in Hype which in turn will place the Score1 rectangle
Hi Mark -
Might you know why I can’t interact with the Noteflight score in your example? According to the API the user should be able to manipulate the score…especially if the parameter ‘role’ is set to 'template" which I have done.
I wonder if this maybe something related to Hype?
In the Noteflight provided example here the score is able to be manipulated.
For some reason the noteflight disables the pointer events for the score1 element.
To fix this run this as the last on scene load action. ( must run after the score has been created and not in the same function as the init one, so create another one and add that to the actions )