Forum Discussion

JeroenVerhoeckx's avatar
JeroenVerhoeckx
Community Member
2 years ago

How to move a rectangle (group of objects) up and down?

Hello Storyline developers,

In the attached slide I want the move 'Group 1' up and down by a click. I already created two motions paths, but only the first one is executed. So 'Group 1' moves to the top, but it doesn't move to the bottom. How can I do that?

Related to this question: when I click on 'Group 1' only 'Motion Path 1'  is shown. How can 'Motion Path 2' be made visible? Is there a location in Articulate Storyline where I can see all Motion paths and there settings?

 

Thanks in advance!

15 Replies

  • I've slightly modified the triggers. Instead of Else, I added an additional trigger with a condition. And it works as well. Most likely, Else is executed after we change the value of the variable. Because of this, the condition is never met. To know for sure, we need to export the slide and look at the code.

  • Of course, it's not logical that the Else check goes after the execution of the second trigger on button click, but most likely this is how it works.

  • Nedim's avatar
    Nedim
    Community Member

    When translated into simple JavaScript, your trigger action would resemble something like this:



    In the provided code, if isTrue is true, the else statement will never execute. It will only execute the if block.

    If you set isTrue to false within the if statement, it will alter the value of isTrue before the else block is reached. Here's how it would look:



    Even in this case, when the button is clicked for the first time, it will set isTrue to false and then perform "action A". Subsequent clicks will execute "action B" because isTrue will be false.

    Your code didn't work because the interaction relies on a click event; nothing will occur until you click, and more important the "Reached_top" variable maintains the value of true after the initial button click. Therefore, you should implement a trigger to toggle the "Reached_top" variable.

    Triggers in the final version will resemble the JavaScript below. The handleClick function toggles the value of isTrue using the ! operator, which negates its current value. Then, based on the new value of isTrue, it performs either "action A" or "action B".



    I'm not very skilled at explanations, but I hope this sheds some light on your inquiry.

  • Hello Nedim,

    Thank you very much for your explanation! It's very clear! Your are right: my mistake was indeed that I should have used a toggle instead only setting the variable 'reached_top' to true. The interface of Articulate Storyline is a bit strange, but I slowly get used to it!