Canevas html

Community Beginner ,
May 11, 2020 May 11, 2020

Copy link to clipboard

Copied

Hello Dear Community

I want to make a bulb light on in a canvas project, by click and hold on the button, and when I release the button is turning off, can you help me with it.

I need the code
Please help

Views

959

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
community guidelines
Contributor ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

var _this = this;

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

	_this.light_off.visible = true;
	_this.light_on.visible =false;

});


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

	_this.light_on.visible = true;
	_this.light_off.visible=false;

});

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
community guidelines
Community Beginner ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

Thanks for the reply , but I don't get you this my fla on the attached file

https://lbhmus.com/fla/bulb.fla

 

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
community guidelines
Community Beginner ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

I got it thanks anyway

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
community guidelines
Contributor ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied


var _this = this;

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

_this.bulb.gotoAndStop('on');
});

 

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
community guidelines
Community Beginner ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

thank you, if I want to add  conditions, click on two buttons ?

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
community guidelines
Contributor ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

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

if (..............................)) {
/////code

} else if (......................................)) {
/////code
} else if (........................)) {
/////code
} else {
////code
}

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
community guidelines
Community Beginner ,
May 12, 2020 May 12, 2020

Copy link to clipboard

Copied

LATEST

thanks you very much

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
community guidelines