Skip to main content
jeffery wright
Inspiring
April 28, 2021
Answered

HTML5 Canvas Cannot set property 'y' of undefined?

  • April 28, 2021
  • 1 reply
  • 462 views

The instance is very clearly defined: 

 

 

External JS file: 

 

 

This has never been an issue before, any idea what the problem could be now? 

 

Thanks. 

 

 

This topic has been closed for replies.
Correct answer ClayUUID

First step of debugging, always: Confirm your assumptions.

 

You assume exportRoot.Mark exists. You assume exportRoot.APDHMIDM exists. Confirm this is true. Stick some console.log() statements in there that display them.

1 reply

ClayUUIDCorrect answer
Legend
April 28, 2021

First step of debugging, always: Confirm your assumptions.

 

You assume exportRoot.Mark exists. You assume exportRoot.APDHMIDM exists. Confirm this is true. Stick some console.log() statements in there that display them.

jeffery wright
Inspiring
April 28, 2021

Thanks for that!

 

It turns out that exportRoot.Mark was mis-Instance named as b_Mark which was the problem.

 

Looking at the line in question I assumed the issue was APDHMIDM  since I would surely never make such a stupid mistake as not naming my button selection marker correctly... which is exactly what happened.

 

I appreciate your help, thanks man!