Need your Help with Drag n Drop!

Hy Guys, em kinda new to hype. I need those circles to drop in to those places (yellowish opacity down) in the image. How em i gonna do it. Please help. here is the hype file Drag n Drop.hype.zip (1.2 MB) once they place the circles correctly it must change it to another slide if they placed wrongly then to another slide.
@Daniel @gasspence @DBear

You can take a look at my drag and drop example that I posted earlier on this forum.

If you want to make it easer to drag and drop this little dots, I suggest to change them into html shapes, place them in a group that is somewhat little bigger. Make the dropzones also a few pixels bigger than the drag-notes.

Take a look at these changes in your document: Drag n Drop 2.hype.zip (310.7 KB)

I also changed the background-picture to a jpg file for better file sizes :wink:

2 Likes

Thank you so much @rene but still i cannot understand. can you help me with the coding what kind of a code should i use.

dragAndDropHype.hype.zip (23.7 KB)
just another example :slight_smile: please also do a forumsearch on drag and drop-examples …

4 Likes

Woow Soo nice @h_classen THank you so much. i think i can put my images into these things.

Hi @h_classen -
I’ve been using your example here for drag ‘n drop for a project and it works wonderfully! However, I’m having trouble getting it to work on multiple scenes. When I load just the second scene with the code it works perfectly but when I start from the first scene that also has the code and the load the second scene, that second scene does not execute the drag n’ drop correctly. The elements drag to the correct place but “success” code is not executed.

Is it possible to get this working somehow?
Thank you!
NFpaste.hype.zip (391.7 KB)

i’m again on a three-weeks-holidaytrip :slight_smile: sry

1 Like

Bloody hell, a lot of code…

First you need to sort out some code errors that show up in the console.

In the version I down loaded I got most of them.

I did this by using the debugger and break points. ( I posted a tip on this )
There are some errors that may be generated because of cross domain. ( I mean the ones that come up as object undefined )

After clearing most of the errors, I think I found your issue.

When you switch to the next scene you do not reset the ’ hypeDocument[hypeDocument.documentId()][‘resCount’] ’ count

I simply added

hypeDocument[hypeDocument.documentId()]['resCount'] = 0;

in the checkDrop() function. directly after ;

var timer = setTimeout( function () {
_ hypeDocument.showSceneNamed(‘2’, hypeDocument.kSceneTransitionCrossfade, 0.4)_

You will probably need to do this for all checkDrop# functions.


Also,
As you see the person who wrote code that you are using may not be available. Others may want to help you but on seeing this amount of code and functions may not want to start from cold.

What would help is if you explain where the code is you expect to work and what is supposed to happen, and some logic behind the code.

Just saying… :smile:

2 Likes

Thank you Mark!