Provide top-level window.ScratchAudio to iframes

This commit is contained in:
Tim Mickel 2016-02-02 17:31:16 -05:00
parent b8f4e84bc9
commit 9814b2a7ce
2 changed files with 4 additions and 2 deletions

View file

@ -226,7 +226,7 @@ function inappInterfaceGuide () {
currentButton.className = 'interface-button';
currentButton = target.parentNode;
currentButton.className = currentButton.className + ' interface-button-selected';
ScratchAudio.sndFXWithVolume('keydown.wav', 0.3);
window.parent.ScratchAudio.sndFXWithVolume('keydown.wav', 0.3);
}
};
document.addEventListener('touchstart', switchHelp, false);
@ -276,7 +276,7 @@ function inappPaintEditorGuide () {
currentButton.className = 'paint-button';
currentButton = target.parentNode;
currentButton.className = currentButton.className + ' paint-button-selected';
ScratchAudio.sndFXWithVolume('keydown.wav', 0.3);
window.parent.ScratchAudio.sndFXWithVolume('keydown.wav', 0.3);
}
};
document.addEventListener('touchstart', switchHelp, false);

View file

@ -183,4 +183,6 @@ export default class ScratchAudio {
}
}
window.ScratchAudio = ScratchAudio;
window.addEventListener('touchend', ScratchAudio.firstOnTouchEnd, false);