Anyone help me please..

Explorer ,
Jun 16, 2020 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

70

Likes

translate

Translate

Translate

Report

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

correct answers 1 Correct Answer

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

Likes

translate

Translate

Translate
Explorer ,
Jun 17, 2020 Jun 17, 2020

Copy link to clipboard

Copied

I came to know the way.

"KeyP" or "KeyS" works well.

Likes

translate

Translate

Translate

Report

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