run an action group AFTER a move action
September 13, 2018 12:00 AM
Is there a way to run an action group AFTER a move action completes?
Discussion (6)
with Javascript sure...pure Lectora actions...have to check... :-)
No easy way to do with just plain Lectora actions. Your best bet is doing the move with GSAP. GSAP has a command OnComplete for its timeline. In fact in a TweenMax timeline you can add sequences of actions after each other,,, they all wait for the previous to end... check my portfolio and samples and you sure find a suitable sample.
Checking my own portfolio here some samples that are usefull to solve this.
If you know the position of an element...well you can trigger whatever action needed when the element is higher then a certain amount...
https://community.trivantis.com/shared-content/get-an-elements-position/
This one does show quite well the possibilities of a sequence with TimelineMax for GSAP
https://community.trivantis.com/shared-content/sequencing-with-gsap-timelinemax/
Kind regards and good luck,
Math
Well, I'm making assumptions because there's no sample included with your post. If you want to initiate a move and then, when it completes, automatically fire off an action group it's extremely simple. Lectora actions fire in sequence. Add a run action group after the move action.
I added a delay before the action group fires so that you see it indeed happens after the move finishes. without a delay it will look simultaneous.
If this is not what you meant, please elaborate and include a sample.
Animated elements and nice transitions go a long way in terms of user experience and engagement with the learning, but building sequences that have more than ten or fifteen steps gets prohibitively complex.
I totally agree.
Maybe add a "THEN" condition next to the "IF" and we could string tasks within an action.
Delays are not necessary. By his question, Rob just needed to be pointed to the run group action and to be reminded that Lectora actions are sequential.
It would be GREAT if Lectora actions had a checkbox 'Wait until previous action complete' (or even a dropdown menu 'Wait until undefined
@Darrel - Your insight was very much appreciated. Despite the fact the actions are sequential, they were happening way too quickly. I needed the move action to happen and then, after it stopped, the next action would run. Unfortunately, I have several buttons launching different move actions with varying distances. That along with the users browser or computer/bandwide speed means the delay would need to be different for each.
This is how I solved my issue:
Math provided a useful piece to the puzzle. I used his idea to track the location of the object that is being told to move. When one of the buttons are clicked the target location is set and the object is told to move. I then created a looping action (with a 0.1 delay otherwise you get an "out of stack space" error) that tracks the object position and stops when the target position is reached. At that point the next action group runs. When I can find time I will created a simplified version without the confidential info.
@mnotermans - Thank you but your avitar still freaks me out.
Discussions have been disabled for this post