Javascript - multiple variables into one

Hi,

in my storyline i have 4 different variables and i want to put all of them into one. So for example variables :Q1,Q2,Q3,Q4 into Q5 for that i created a Javascript trigger which looks like that:

var text = "Party invitation: " + Q1 + " Where: " + Q2 + " When: " + Q3 + "Activities: " + Q4

var player = GetPlayer();
player.SetVar("Q5",text);

But the trigger is not working....what i do wrong?

Thank you :)

 

 

3 Replies
Michael Hinze

Are Q1...Q4 Storyline variables? In that case, try:

"

var player = GetPlayer();
var JSQ1= player.GetVar("Q1");
var JSQ2= player.GetVar("Q2");
var JSQ3= player.GetVar("Q3");
var JSQ4= player.GetVar("Q4");

var text = "Party invitation: " + JSQ1 + " Where: " + JSQ2 + " When: " + JSQ3 + "Activities: " + JSQ4;

player.SetVar("Q5",text);

"