Highlighted

What can I use for ((keyPress "<Space>")) ?

Explorer ,
Jun 08, 2020

Copy link to clipboard

Copied

===========================
<<Action Script 1.0>>
on (release, keyPress "<Space>") {
gotoAndStop(10);
tellTarget ("_root") {
play();
}
}

===========================

In Animate 2020, What can I use for ((keyPress "<Space>")) ?
===========================

 

var _this = this;
_this.stop();

var _this = this;

_this.PlayMovie.on('click', function(){

_this.gotoAndPlay(50);
});

===========

In this script, what can I add for keyPress(space bar) event?

I hope anyone will help me for this problem.

 

TOPICS
ActionScript

Views

190

Likes

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

What can I use for ((keyPress "<Space>")) ?

Explorer ,
Jun 08, 2020

Copy link to clipboard

Copied

===========================
<<Action Script 1.0>>
on (release, keyPress "<Space>") {
gotoAndStop(10);
tellTarget ("_root") {
play();
}
}

===========================

In Animate 2020, What can I use for ((keyPress "<Space>")) ?
===========================

 

var _this = this;
_this.stop();

var _this = this;

_this.PlayMovie.on('click', function(){

_this.gotoAndPlay(50);
});

===========

In this script, what can I add for keyPress(space bar) event?

I hope anyone will help me for this problem.

 

TOPICS
ActionScript

Views

191

Likes

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
Jun 08, 2020 0
Adobe Community Professional ,
Jun 09, 2020

Copy link to clipboard

Copied

Hi.

 

You need to add an event listner of the keydown type and check for the space key. Like this:

var _this = this;

_this.stop();

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

 

I hope this helps.

 

 

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

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
Reply
Loading...
Jun 09, 2020 1
buksori LATEST
Explorer ,
Jun 11, 2020

Copy link to clipboard

Copied

Thank you for your help.

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

When I want to use both "mouse click" and "keydown", how can I insert "keydown" in the above script?

I hope you will help me again.
Thank you.

 

Regards,

buksori

Likes

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
Reply
Loading...
Jun 11, 2020 0