HTML5 Canvas - Nested button to move parent

Engaged ,
Feb 20, 2022 Feb 20, 2022

Copy link to clipboard

Copied

I have a graphic symbol which contains a nested button.  When clicked, I want that button to move the parent graphic symbol to a location X Y.

 

This is not working, though the nested button gets it's pointer cursor.

 

this.closeLens.addEventListener("click", closeThisLens.bind(this));

function closeThisLens()
{
	this.parent.x = -200;
	this.parent.y = -850;
}

Views

50

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

correct answers 1 Correct answer

Adobe Community Professional , Feb 20, 2022 Feb 20, 2022
Hi. Is the code located inside of the Graphic symbol? Because actions don't run on the timelines of Graphic symbols. You need to convert your Graphic to Movie Clip and replace this.parent in the code by this only because you want to move the Graphic instance itself and not its parent. Regards, JC

Likes

Translate

Translate
Adobe Community Professional ,
Feb 20, 2022 Feb 20, 2022

Copy link to clipboard

Copied

Hi.

 

Is the code located inside of the Graphic symbol? Because actions don't run on the timelines of Graphic symbols. You need to convert your Graphic to Movie Clip and replace this.parent in the code by this only because you want to move the Graphic instance itself and not its parent.

 

Regards,

JC

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
Engaged ,
Feb 20, 2022 Feb 20, 2022

Copy link to clipboard

Copied

Thanks JC, that did the trick!

 

Peter

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
Adobe Community Professional ,
Feb 21, 2022 Feb 21, 2022

Copy link to clipboard

Copied

LATEST

Awesome!

 

You're welcome!

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