Anyone help me please..

Explorer ,
Jun 16, 2020

Copy link to clipboard

Copied

var _this = this;

_this.gotoPlayBtn.on('click', function()
{
	_this.gotoAndPlay(216);
});

window.addEventListener("keydown", function(e)
{
	if (e.code === "Space")
		_this.gotoAndPlay(216);
});

 

I tried to use "Space" and "Enter" key. They worked well.

But I wonder why other keys(ex: p key, s key , alt key, ctrl key and etc) except Space and Enter key don't work.

How can I use other keys(ex: p key, s key , alt key, ctrl key and etc) except Space?

 

Thank you.

Views

59

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Explorer , Jun 17, 2020
buksori Explorer , Jun 17, 2020
I came to know the way."KeyP" or "KeyS" works well.

Likes

Translate

Translate
Jump to answer Jump to answer
Explorer ,
Jun 17, 2020

Copy link to clipboard

Copied

I came to know the way.

"KeyP" or "KeyS" works well.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more