JavaScript execution issues

Jun 28, 2016

Hi, I am trying to run java script in my story line project. that connects a data entry for the name and id number as well as a page number. i want it to be an alert box once the user click starts. in story line the JS is before jumping to next page. (see screen shot)
and this is my code: 

var CBTPlayer = GetPlayer();

var CBTData = new Object();

var CBTYourName = player.GetVar('YourNameHere');
var CBTpage = player.GetVar('crpage');
var CBTReference = player.GetVar('ReferenceNumber');

 

CBTData['CBTNameHere'] = YourNameHere;
CBTData['CBTReference'] = ReferenceNumber;
CBTData['CBTpage'] = 1;

Alert("welcome" + player.GetVar("YourNameHere"));

am I doing something wrong?

6 Replies
Russell Killips

I'm not sure what you are using the object for. The complete code could be this.

var CBTPlayer = GetPlayer();

var CBTData = new Object();

CBTData['CBTNameHere'] = CBTPlayer.GetVar("YourNameHere");
CBTData['CBTReference'] = CBTPlayer.GetVar('ReferenceNumber');
CBTData['CBTpage'] = CBTPlayer.GetVar('crpage');

alert("Welcome " + CBTPlayer.GetVar("YourNameHere"));

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