Copy link to clipboard
Copied
All I need is just a simple drag and drop. To be honest I have no idea about html 5 😃
I have a movieclip, let's call it exampleClip or something.
And all I want to do is make drag and drop possible, no extras.
exampleClip.on("pressmove", function(evt) {
evt.target.x = evt.stageX;
evt.target.y = evt.stageY;
});
This I have found already, but in test it didn't work. Just played the gif.
Copy link to clipboard
Copied
this.exampleClip.addEventListener('pressmove', drag_step1F.bind(this));
this.exampleClip.addEventListener('pressup', drop_step1F.bind(this));
function drag_step1F(e){
e.currentTarget.x = (e.stageX)/stage.scaleX ;
e.currentTarget.y = (e.stageY)/stage.scaleY;
stage.update();
}
function drop_step1F(e){
// do whatever
}