How To Get Objects in JS?

Feb 06, 2016

I am trying to get the path or some sort of reference to an image on one of my slides so I can manipulate it with javaScript.  Is this possible?  I am thinking is should look something like this:

var player = getPlayer();
var obj = player.getObject("nameOfMyObject");

alert(obj["path"]);

Obviously this does not work but is there a way to do this?
2 Replies
Zsolt Olah

The player object actually has some information on the project (you may parse through all the objects in it using JavaScript if you're curious) but you won't be able to use that to access slide elements. Also, there's no way directly control object states from JavaScript (it would be HUGE help if we could). You can only control variables set/get in JavaScript, and then use triggers in Storyline as Matthew said. 

Christie Pollick

Hi, Alex -- Looks like you've got some really helpful replies from Matthew and Zsolt already! 

I just thought I should stop in to note for anyone who is considering using JS as an option, unfortunately, we are not able to provide support for JavaScript coding. Luckily, we have lots of community members who are more than willing to share their expertise to assist!

And for those who'd like to review it, here is a sheet on JavaScript Best Practices you may want to keep handy. :)

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