Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript jQuery Basics (2014) Creating a Simple Drawing Application Perform: Part 5

Anthony Lafont
Anthony Lafont
17,075 Points

TypeError: undefined is not an object (evaluating 'lastEvent.offsetX')

Hi everyone,

I can't find what I'm doing wrong! here is the snapshot of my code : https://w.trhou.se/rgrlu5t7zv

Thanks!

Noel Peña
Noel Peña
5,900 Points

Hi Anthony,

In the app.js file check line 56. It looks like you are using the assigning operator (=) vs the check for comparison operator (==). Should be:

if (mouseDown == true) {

or just

if (mouseDown){

2 Answers

Tom Gooding
Tom Gooding
16,735 Points

Hi Anthony

Check your comparison operator in the if statement for .mousemove... You're currently setting mouseDown to true every time the mouse moves!

Cheers

Anthony Lafont
Anthony Lafont
17,075 Points

Dammit! I should have saw that :/

Thanks guys, you rock!