Converting an Actinscript code to Javascript for HTML 5 canvas.
I'm working on an animation on action script through Animate CC and need to convert it to HTML 5 canvas which I have done. Issue being the only code format I am having trouble converting to java script is the following :
stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownListener);
function keyDownListener(e:KeyboardEvent){
if (e.keyCode == Keyboard.RIGHT) {
nextFrame();
}
if (e.keyCode == Keyboard.LEFT) {
prevFrame();
}
}
If anyone can help me if would be much appreciated as this is mainly needed for a web browser. TIA.
