4 Replies
Mike B.

As said above, you can do this using a combination of javascript and triggers. Create a variable in SL, set the variable to a particular value with your javascript code (see below), and then create SL triggers in your course that show or hide your layer when that SL variable value changes.

In the example below "ShowLayer1" is a variable that you create in your SL course.

Sample js code:

var player = GetPlayer();
player.SetVar("ShowLayer1","Yes");

 

David G

Hi,

I would very much appreciate if anyone can elaborate on how to get hold of layers when using javascript.

Is it possible to get hold of wheter checkboxes are selected or not in plan javascript with some getplayer method? This would improve my workflow, not needing to create extra variables and use extra SL triggers for stuff that can be done very easily in plain javascript. 

Thanks!

/David