Slide layer to randomly appear on timeline
Dec 11, 2018
By
Kaman Leung
I've done some Googling, and I haven't been able to find anything similar to what I'm trying to do, so I'm hoping someone can help me here.
I'm trying to build a RPG type scenario, where "distractions" will show up randomly as the user is on a slide. I have distractions set up on slide layers, I don't want the distraction slide layer to show up at set times, I want them to show up randomly throughout the timeline so that the user cannot predict when they will show up. Is it possible to have a slide layer automatically appear randomly throughout the time line?
I am ok with trying to use Javascript to do this, but I'm not sure what kind of code I would need.
Thanks!
6 Replies
You could create a javascript trigger that executes itself every 1 second (setInterval) or how often you want, and have it display your layer or not randomly. Let me know if you need some sample code. You would not have to reference the timeline at all in this situation, unless you need to.
Thanks for the response Michael! Yes, sample code would help, please! Thank you!
For a non-JS option, see this quick, rough example here. I use a looped motion path animation and two random number variables to determine when and which layer is displayed.
Thanks Michael, any chance I can take a look at your source file?
Very nice Michael!
Here is the .story file. I hacked this together quickly. Hope it makes sense.
This discussion is closed. You can start a new discussion or contact Articulate Support.