Automatically change position of any element on a slide

Jul 29, 2020

It could be nice to have a trigger which changes the position of elements on a slide maybe based on the results of another variable or no another trigger . Example:

change the position of the object 1 to new position (X axis, Y axis)

when the user click button 1

 

 

 

3 Replies
Ren Gomez

Hi Andrea,

One idea would be to add a copy of the object in the area you'd like it to change to and set the initial state to Hidden.

When the user clicks a button, you can add triggers to set Object 1 to Hidden, then set Object 2 to Normal. See below for an example, plus I've shared the file as well for reference!

Math Notermans

or use TweenLite. GSAP's library that is build into Storyline and controls all animations behind the scenes in Storyline.

Check this where i get x/y from Entry fields, set that to vars and use those for the animation.

Basically this is the code you need to animate anything.

var player = GetPlayer();

var candyObject = document.querySelectorAll("[data-acc-text='obj01.png']");
var ipX = player.GetVar("ip_X");
var ipY = player.GetVar("ip_Y");

var offsetTop = ipY;
var offsetLeft = ipX;

TweenLite.to(candyObject, 1, {x:offsetLeft,y:offsetTop});

moveMe

 

Added this sample as attachment...

This discussion is closed. You can start a new discussion or contact Articulate Support.