Skip to main content
edm64045680
Inspiring
November 28, 2017
Question

Can drag sources start off already positioned in a drop target?

  • November 28, 2017
  • 2 replies
  • 844 views

Hello community - this is my first post!

My question is: When a slide loads, with a drag and drop interaction in it, can the drag sources start off already positioned in a drop target? Below is more explanation of what I am trying to achieve and why.

I have five drag sources

I have two drop targets: drop target A and drop target B.

I would like the drag sources to start already in position (tiled) in drop target A.

In the “Accepted Drag Sources”” window for drop target B, Count is set to 1 and On Accept is set to Replace.

When a user drags a drag source from drop target A onto drop target B my variable is incremented by 1.

When user drags another drag source from drop target A onto drop target B the replaced drag source returns to drop target A and my variable is decremented by 1.

I wouThe advanced actions I can deal with, but I'd be very grateful for any guidance around whether I can start a slide with drag sources already positioned in a drop target. Thank you.

    This topic has been closed for replies.

    2 replies

    Stagprime2687219
    Legend
    November 28, 2017

    Perhaps I do not fully understand what is being attempted but I was able to create two shapes and make them two distinct drop targets.

    I then created four stars of different color and made them all drag sources. I placed two in one target and two in the other layered one on top of the other.

    When I previewed the slide I was able to drag them all back and forth from one target to the other target.

    So - in this sense - yes, a slide can start with multiple drag sources already inside of it.

    Make sure the drag sources are the uppermost layers.

    I didn't try to do anything with the actions, though. Perhaps that is the sticking point...?

    What am I missing?

    edm64045680
    Inspiring
    November 29, 2017

    Hi Stagprime. Thanks for looking into this. I recreated what you described and it works beautifully until I add the advanced actions.

    In short, what I am trying to achieve is:

    When the drag source lands on drop target B the variable is incremented

    When the drag source is removed from drop target B the variable is decremented (in my project the drag source is removed by being replaced by another drag source)

    I cannot find a way to decrement the variable when the drag source is removed from drop target B. As a newbie my terminology may be incorrect here, but my understanding is that an "event" is needed to attached the decrement advanced action to. I don't believe there is an "event" relating to the removal of a drag source from a drop target. I know that there is an "event" for when a drag source sucessfully lands on a drop target. Therefore my thinking was to have a second drop target (in my example above "A") for the removed/replaced drag source to "land" back on and this would provide the "event" required for me to attach the decrement advanced action to. Unfortunately, it appears that your solution does not actually "snap" the drag sources into that drop target (and therefore the "event" I am looking for to attach the advanced action to decrement the variable does not occur).

    Perhaps there's another way to achieve what I am looking for?

    Thanks all again for your help.

    RodWard
    Community Expert
    Community Expert
    November 29, 2017

    You present an interesting problem.

    I don't think any usable event is fired in Captivate by the drag object currently sitting on a target being displaced by another drag object.  And even though the displaced drag object might happen to land on another target object, I don't think that counts as a usable even either because it wasn't dragged and dropped there.

    You're on the right track though with the approach that, if an object has already been dropped on a target, you can use the Object Action fired by another drag object being dropped on the same target to decrement the variable associated with the previous object.

    However, this Object Action really needs to be a Conditional Action that first looks to see the values of a number of other tracking variables before executing any actions.

    For example, each Target Object would ideally needs to know exactly which Drag Object it is currently sitting on top of it.  But unless you are always starting out with specific Drag Objects positioned over specific Targets and there is no randomisation of positioning involved.  Only once you start dragging objects around and dropping them on targets do you get the possibility of using Conditional Actions to dynamically affect what is happening.

    Your Object Actions need to be set up not only to increment or decrement variables, they also need to set the values of other variables that are tracking the positions of each relative object.

    I haven't had to set up a drag and drop interaction to do all of this as yet but my gut is telling me that it's going to take some tinkering.

    edm64045680
    Inspiring
    November 28, 2017

    Actually it's my second post in the Captivate forum. My mind is turning to mush after so much swotting up on Captivate!

    Lilybiri
    Legend
    November 28, 2017

    One or the requirements for Drag&Drop is that no overlap is allowed between objects. This would mean that your scenario is not possible.

    edm64045680
    Inspiring
    November 28, 2017

    Thank you Liybiri