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 trialAnthony Lafont
17,075 PointsTypeError: 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!
2 Answers
Tom Gooding
16,735 PointsHi 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
17,075 PointsDammit! I should have saw that :/
Thanks guys, you rock!
Noel Peña
5,900 PointsNoel Peña
5,900 PointsHi 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){