Forum Discussion
Allow only one item in each drop target - Not working!
In this project, the user has to drag the photo of each person to its correct location below.
I have set triggers that change each picture to a « Disabled » state when it is dropped on the correct location, so the user cannot move it again, once it is dropped on the correct spot.
I have also set the Drag & Drop Options to « Allow only one item in each drop target ».
It works as expected when I drop items to the correct locations.
For example, if I drag the second photo to its correct location, it becomes disabled and I can’t move it again. This is what I want.
But if I drag another photo on the same spot, it removes the first picture, which returns to its original location and remains disabled, so I can’t do anything with it.
Why am I able to drop multiple items to a same drop target when I specified « Allow only one item in each drop target » in the Drag & Drop Options?
I'm using Storyline 360. See attachment below.
- WaltHamiltonSuper Hero
Math's sample makes it so that only one object can be dropped on a target ever.
I think what you are asking for is the attached sample. Each target becomes disabled only when the correct object is dropped on it. For each person, delete the other triggers. Then on slide 1.1, I added a rectangle and a trigger (only to Amande) that resets the target if the correct object is dragged off it.
Or if you don't want the object dragged off after it is dropped on the correct target, see slide 1.2. Again only Amande works.
- JCBlanchardCommunity Member
Thanks Walt, that's exactly what I need!
- WendyFarmerSuper Hero
Hi JC
I'm not seeing that behaviour in Preview - see this Peek.
If I drag another photo on the same spot, it removes the first picture, which returns to its original location and remains disabled, so I can’t do anything with it.
This is expected behaviour of 'allow only one item' - it's doing the replacement when you drop another object onto it but I'm not finding that the item is disabled. Perhaps I misunderstand the issue.
- JCBlanchardCommunity Member
Hi Wendy,
No, I think I misunderstood the meaning of "allow only one item". It actually means "one item at a time"! Thanks for clearing that up.
What I would like to do is make the object unmovable after it has been dropped on the correct target. Is that possible do you think?
- WendyFarmerSuper Hero
Hi JC
I would disable the drop target and drag object once the correct drop has been made
- JCBlanchardCommunity Member
How do you disable a drop target? I tried covering it with a transparent shape, changing its state to Disabled, but nothing seems to work.
This is what is happening. After having dragged an object to the correct drop target, this target is still active. If I drag another object on it, it replaces the correct one : https://360.articulate.com/review/content/7aaa6af6-afcc-4d1b-95f4-f7cc22e232fa/review
- WendyFarmerSuper Hero
Hi JC
I named the drag and drop objects so I know which is which. Then I have two triggers
See this Peek - only worked on Lucien objects. Is this the behaviour you are after?
- JCBlanchardCommunity Member
Hi Wendy,
Here is another video explaining more clearly, I hope, what I'm after.
https://360.articulate.com/review/content/611fe0c7-7b55-4691-8a04-9672b1430a97/review
Essentially, I want to disable the drop target once the correct item has been dropped on it, so that the user will not be able to drop anything else on it.
- AndrewEngland-2Community Member
I'm experiencing this exact same issue but as this has been left open ended, I'm wondering if a solution was found?
- MariaCSStaff
Hi, Andrew.
Since this discussion is from a few years ago, can you expand on what issues you're having?
If you're comfortable sharing your .story file, I'm happy to take a look and help troubleshoot!
- MathNotermans-9Community Member
The trick to solving this is adding a custom empty state to your droptargets. When dropping anything on it, trigger it to that empty/deleted state...and it will be removed from the drag-drop event and no other draggable objects can be placed upon it.
As seen here...
- JCBlanchardCommunity Member
Hi Math,
It does not work. Drop targets disappear when I drag the wrong object on it.
- WaltHamiltonSuper HeroYou're welcome. PIAWYC (Pass it along when you can).
- BadrHamraouyCommunity Member
any idea where to find or make the 'Allow only one item in each drop target', option appear on my project ? couldn't find it !