Drag Source Position

Problem: I’m trying to set the left and top position of some drag source shapes with slide load javascript, however the shapes always return to orignial positions on revert or if revert is unchecked they jump to the translated position from their original position on first drop. Is there a way to set the position of a drag source shape so that it will be treated as the original position?

ActivePresenter Version: 7.5.13

OS: Windows 10

Notes:

Hi,

You should use translation tranformation instead of position for drag sources. For example:

// move object 200px to the right, 300px down
prez.object('drag source name').translate(200, 300);

Regards

That’s great, thanks for your help.

Hi,
I think I have a related problem.
I have a slide with some drag-and-drops (NOT as part of a Drag-n-Drop question). I want to give users the option to redo the slide after they have sucessfully completed it. However, the drag sources seem to stay with their drop targets. I tried to ‘Clear User Input’ and position the drag sources through JS but this does not seem to work.
Is there any way to ‘undo’ the drop so that the drag sources will go back to their initial position?

Thanks, Rolf

Hi Rolf,

“Clear User Input” action will not work for hidden interactions.
If your drop targets appear at the beginning of the slide, you can add “Clear User Input” action to the slide On Load event to move drag sources to their original positions.
Otherwise, you can use an Animated Timer to clear user input at the time when the drop targets appear.

Regards

1 Like