OAM file keyboard function not working when in Captivate
I'm working on a responsive Captivate 2017 project with breakpoints. I have created a simple animation in Adobe Animate, that has a movieclip and a button on it. When the button is pressed it plays the movieclip, but I also want this to be keyboard accessible, so I made it that when the user hits the 'g' key the movieclip will play as well.
This is what my code in animate looks like (movieclip is named 'takeOff' and button is named 'goBtn'):
this.play();
createjs.Touch.enable(stage);
this.goBtn.addEventListener("mousedown", go.bind(this));
function go(){
this.takeOff.gotoAndPlay(1);
}
window.addEventListener("keydown",keyPressed1.bind(this));
function keyPressed1(evt){
var theKey = evt.key.toLowerCase();
if(theKey=="g"){
this.takeOff.gotoAndPlay(1);
}
}
It works perfectly when I test it in Chrome. It's an HTML5 document in Animate.
When I export it as an OAM file and add it into my Captivate project, clicking the button works to run the movieclip, however pressing the G key does not. I'm wondering if it is not communicating the key event within Captivate? I'm not a coder and don't know much about this kind of stuff. Is there anyway to make it so that when the OAM is embedded in Captivate it can still listen for the key press event? Not sure why the mousedown function is still working, but the keydown is not.
Thanks!
