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

How to move an object between multiple locations using buttons?

Guest
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

Hello everyone. In a Captivate 2019 course I am creating, I need the user to be able to move an image object between multiple points using buttons. Is there a way to move an object smoothly from one point to another using advanced actions or java script? The reason I ask is because the motion path functionality seems to be tied to the timeline for each slide, which seems limiting. I'd like to be able to indicate, no matter where they are in the timeline, if X button is pressed, move the object from this location to that location. Is that doable? Thank you in advance!

Views

408

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

correct answers 1 Correct answer

Community Expert , Jul 18, 2019 Jul 18, 2019

You can launch a motion effect with a button and/or with advanced/shared actions.

Have a look at the blog post I published yesterday, an example of motion effects triggered by a toggle button:

Sliding Menu - Captivate blog

Votes

Translate

Translate
Community Expert ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

You can launch a motion effect with a button and/or with advanced/shared actions.

Have a look at the blog post I published yesterday, an example of motion effects triggered by a toggle button:

Sliding Menu - Captivate blog

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
Guest
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

Super helpful - thank you!

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 Expert ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

LATEST

You're welcome. I'm sure that with JS much more can be achieved, but tried to show what is possible with motion paths in Captivate.

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
Advisor ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

This little block of code would move a box on your stage with the name of box to the right by 150 pixels over the course of a half second.

If you want to move something to the left - still use left but put in a negative value for the pixels.

If you want to move something up or down - use top instead of left with plus or minus values in the same way.

$(document).ready(function() {

$("#boxc").animate({left: "150px"}, 500);

});

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
Advisor ,
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

Better yet - You could also create a little directional pad and use them to nudge your object so many pixels in a particular direction.

For that just use a  +=  or a  -=  in front of your pixel distance. This would be for an object with the name of  box.

Right Button

$(document).ready(function() {

$("#boxc").animate({left: "+=50px"}, 500);

});

Left Button

$(document).ready(function() {

$("#boxc").animate({left: "-=50px"}, 500);

});

Up Button

$(document).ready(function() {

$("#boxc").animate({top: "-=50px"}, 500);

});

Down Button

$(document).ready(function() {

$("#boxc").animate({top: "+=50px"}, 500);

});

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
Guest
Jul 18, 2019 Jul 18, 2019

Copy link to clipboard

Copied

This was helpful information for the future as well! Thank you!

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
Resources
Help resources