• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Full Drag and drop tutorial with animate cc HTML5 Canvas

Explorer ,
Feb 15, 2016 Feb 15, 2016

Copy link to clipboard

Copied

hello

i made this tutorial in animate cc on how to do drag and drop with easeljs and how to lunch animation on drop

i wanted to share this since there is no one want to help and give an example so here is a full drag and drop tutorial with createjs in animate

Drag and Drop Tutorial with Animate CC easeljs (HTML5 Canvas) - YouTube

please support the channel and thanks

TOPICS
How to

Views

18.8K

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
community guidelines
Enthusiast ,
Feb 16, 2016 Feb 16, 2016

Copy link to clipboard

Copied

Votes

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
community guidelines
Participant ,
Sep 08, 2017 Sep 08, 2017

Copy link to clipboard

Copied

If you looking for help I can give you a working example which even works in firefox with a new Animate CC Version and a new EaselJS Version and a responsive Size of the canvas Element, because your youtube example does not work with this conditions.

There is a also a much easier way to get the "dropTarget rectangle"

Take a look at: this youtube Tutorial:

Drag and Drop, Animate CC, Canvas - YouTube

Votes

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
community guidelines
Explorer ,
Sep 09, 2017 Sep 09, 2017

Copy link to clipboard

Copied

yes you are true animate cc now support responsive layout which dose not let the old code work,

also for the collision detection there are many ways to do it, your example is good and i already made many type of drag and drop even with box2d in animate cc

thanks for your effort

Votes

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
community guidelines
LEGEND ,
Sep 09, 2017 Sep 09, 2017

Copy link to clipboard

Copied

No, Animate does not support responsive layout. It supports scaling, which is a completely different thing. Whoever on the Animate dev team labeled that "responsuve" in the publish settings didn't understand what the term means. Everyone should report this as a bug on the feedback form to encourage them to correct it.

Votes

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
community guidelines
Participant ,
Sep 09, 2017 Sep 09, 2017

Copy link to clipboard

Copied

Of course it is scaling and positioning of the canvas Element. But you can even choose, that the canvas element is cropped horizotally or vertically. That is some sort of layout. Responsive means it reacts to the conditions of the browser window. You can make a totally new layout for a html page for different screen sizes. That is responsive layout, every webdesigner knows that,

But this can not work in a canvas animation or game. So I think Adobe has not made a mistake or bug, they have just programmed the possibilities which make sense.

Votes

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
community guidelines
LEGEND ,
Sep 09, 2017 Sep 09, 2017

Copy link to clipboard

Copied

pastorpixel  wrote

But this can not work in a canvas animation or game. So I think Adobe has not made a mistake or bug, they have just programmed the possibilities which make sense.

That's why games generally DON'T use responsive layout.

Votes

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
community guidelines
Engaged ,
Oct 19, 2017 Oct 19, 2017

Copy link to clipboard

Copied

Great tutorial, very cool.

Modifying your code I have added multiple draggers, in their 'pressup' functions I have added the line: box.gotoAndStop("b_present");

b_dragger.on("pressup", function(evt) {

  if(intersect(evt.currentTarget, destination)){

 

     box.gotoAndStop("b_present");

     stage.removeChild(b_dragger, destination);

     stage.update(evt);

 

  }else{

      

b_dragger.x = 922;

b_dragger.y = 768;

     }

});

For every dragger that intersects the "destination" i want the 'box' to change in appearance, by making it jump to another frame within it.

This is not working and is not throwing any errors in the console... the other commands in the function still work but my 'gotoAndStop' does not.

How is it possible to trigger a command that does that within the function?

It's odd that the line doneDrag.gotoAndPlay(1); does work, but box.gotoAndStop("b_present"); or even box.gotoAndPlay(5); does not work?

What is the difference?

Thanks.

Votes

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
community guidelines
Community Beginner ,
May 10, 2021 May 10, 2021

Copy link to clipboard

Copied

LATEST

Thank you so much!!!!!!!!!!!!!!!!!!!!!!!!!!! Menjli. This is really helpful.

kind regards,

Hagos

Votes

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
community guidelines