Forum Discussion
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
- AlexMilyaev-f86Community Member
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.
- AlexMilyaev-f86Community Member
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.
- JeroenVerhoeckxCommunity Member
@Alex: your solution is also very nice! Very understandable! Thanks!
- NedimCommunity Member
When translated into simple JavaScript, your trigger action would resemble something like this:
In the provided code, ifisTrueistrue, theelsestatement will never execute. It will only execute theifblock.
If you setisTruetofalsewithin theifstatement, it will alter the value ofisTruebefore theelseblock is reached. Here's how it would look:
Even in this case, when the button is clicked for the first time, it will setisTruetofalseand then perform "action A". Subsequent clicks will execute "action B" becauseisTruewill befalse.
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. ThehandleClickfunction toggles the value ofisTrueusing the!operator, which negates its current value. Then, based on the new value ofisTrue, 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. - JeroenVerhoeckxCommunity Member
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!
Related Content
- 3 years ago
- 2 years ago
- 10 months ago