+ 1

[solved]touch event error

Why when I print event.clientY or event.ClientX does it print an undefined value?. Help me please.Thanks https://code.sololearn.com/WAn5W9R6Sj5T/?ref=app

28th Jul 2020, 1:05 AM
Emanuel MaliaƱo
Emanuel MaliaƱo - avatar
7 Answers
+ 7
event.touches[0].clientX Touch events keep track of multiple touches. You're welcome.
28th Jul 2020, 1:22 AM
Kevin ā˜…
+ 7
Emanuel MaliaƱo as funny as this may seem I changed line 28 to path(clip, m.x. m); and your error disappeared and the code worked fine... but I would follow what CalviÕ² did.
28th Jul 2020, 2:05 AM
BroFar
BroFar - avatar
28th Jul 2020, 1:42 AM
CalviÕ²
CalviÕ² - avatar
+ 3
Emanuel MaliaƱo BroFar The code has no problem with mousemove event, but the the event call the path function path(clip, m.x. m.y); has syntax error. It should be path(clip, m.x, m.y);
28th Jul 2020, 5:26 AM
CalviÕ²
CalviÕ² - avatar
+ 2
BroFar šŸ˜³šŸ˜ I think the error appears when the mousemove event occurs but I'm not sure about it, CalviÕ² what it did was delete that event and the error disappeared but if you don't delete that event and just click on the screen you get an error.
28th Jul 2020, 2:12 AM
Emanuel MaliaƱo
Emanuel MaliaƱo - avatar
+ 2
āœŒšŸ˜…fixed
28th Jul 2020, 7:20 AM
Emanuel MaliaƱo
Emanuel MaliaƱo - avatar
+ 1
Kevin ā˜… thanks man
28th Jul 2020, 1:25 AM
Emanuel MaliaƱo
Emanuel MaliaƱo - avatar