javascript - Drag and drop with easeljs in Animate CC 2017 -


i've been using html canvas project in adobe animate cc 2015.2 drag around movieclip on stage, using method recommended in creatjs mouse interaction tutorial. doing on macbook pro running os x yosemite @ work.

here code used , worked fine. movieclip on stage in first frame of timeline , actions in same frame. movieclip instance (my_mc) follows mouse around - far good.

this.my_mc.on("pressmove", function(evt){     evt.currenttarget.x = evt.stagex;     evt.currenttarget.y = evt.stagey; }); 

however, trying exact same example in animate cc 2017 on 2 friends' macbook pros retina display running macos sierra, results in there being strange , significant offset between position of mouse , position of movieclip. offset bigger further away mouse moves origin (0,0) of stage.

does know why happening or can think of workaround? i've tried few modifications using globaltolocal, not solve problem.

the 3 main reasons can think of are:

  • some change in animate cc 2017 causing problem
  • the retina display causing problem
  • macos sierra causing problem

any thoughts or workarounds welcome.

thanks in advance,

dave

i think i've sorted problem. following seems work on both animate cc 2015.2 , animate cc 2017 irrespective of os , display resolution.

this.my_mc.on("pressmove", function(evt){     var p = stage.globaltolocal(evt.stagex, evt.stagey);     evt.currenttarget.x = p.x;     evt.currenttarget.y = p.y; }); 

i still have head around why change necessary in animate 2017 , not in animate cc 2015.2 (scratches head).

thanks,

dave


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -