Names for Javascript Files in the Triggers Window

Hi Heros,

Is there a way that SL gives names to the JS files just like other objects?

In the Triggers window, the list of triggers are shown and the user can recognize these objects by names and some of their properties. This is not available for JS and it can be a bit annoying if he/she needs to open the files one by one to identify the function of the JS. If only a couple of JS files are there, this should be fine but it gets difficult if these JS are many and located on different buttons, layers, slides...

What I do as a workaround is to put comments on the top of JS.

Are there any better ways?

 

3 Replies
Math Notermans

I use one external javascript file.... generic_functions.js that i add with a WebObject. In that js file i have dozens of reusable functions i use a lot.

To name a few:
showObject( _target,_duration );
hideObject( _target, _duration );
changeText( _target,_string,_styles);
changeSVG(_target,_svg,_styles);

All these functions and many more are inside the generic_functions.js and i never need to worry about scope or if they are available. Also i donot need to worry much about triggers.. i just have 1 js file i work with in Sublime Editor. On the trigger(s) in Storyline i just call a function. Often i also add a _from argument to a function.

Eg. showObject(_target,_duration,_from);

So on a trigger i can call... showObject("myAccName1",2,"click on Button1");
in my function i have code like this...
console.log("called from: "+_from);

And thus i always know what triggers and when...