trying to add spacebar event listener
Hi there,
I'm trying to add an eventlistener to my HTML5 canvas project. I've got a timeline which has the stop() comand at specific frames. When the user presses the spacebar I'd like playback to continue from the current frame.
Here's what I've tried, but it doesn't work when published.
function onSpacebarPress(event) {
// Get the current frame number.
var currentFrame = stage.frameLabel;
// Play the timeline from the current frame.
timeline.play(currentFrame);
}
// Add the event listener.
stage.addEventListener("keydown", onSpacebarPress);
THanks in advance fo r any help!
