Wonder if anyone has any suggestions re this:
I have a scene that contains 4 buttons that trigger an animation containing seven more buttons. Each of those buttons reveal a new location shown on a map (each location is contained on its own timeline).
When one of the four buttons is clicked it triggers a new animation that plays any of the other three in reverse - clearing the stage for the new information.
At present the only way I can clear the map completely is to manually enter actions that play each of the locations in reverse - very time consuming.
So my question is this - can I generate some javascript that will speed up this process?
you’ll need
an array containing all timelinenames
var timlinesArray = [‘lsjehfghskd’, ‘kshegf’, ‘jgh’]
id for each element equal to corresponding timlinename,
onClick or on touchStart run:
var timelinesArray = ['one', 'two', 'three'];
var currentTimelineName = element.id;
for (var i=0; i < timelinesArray.length; i++)
{
var timelineName = timelinesArray[i];
if(currentTimelineName === timelineName)
{
hypeDocument.continueTimelineNamed(timelineName, hypeDocument.kDirectionForward, true)
}else{
hypeDocument.continueTimelineNamed(timelineName, hypeDocument.kDirectionReverse, true)
}
}
Thank you again, that worked although I can’t see why a direction of “false” for reverse is logical - but then I can never get my head around JS. Just when I think I’m getting some understanding it trips me up!