Highlighted

html5 drag and drop

New Here ,
Feb 13, 2020

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.

TOPICS
Code, How to

Views

46

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

html5 drag and drop

New Here ,
Feb 13, 2020

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.

TOPICS
Code, How to

Views

47

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 13, 2020 0
kglad LATEST
Adobe Community Professional ,
Feb 13, 2020

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

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 13, 2020 0