Hey all, we need some help with figuring this out, I have been trying to create an if statement that activates a state after a video has finished I first tried to add a boolean and say if true activate the state however I ran into this problem:
The (Startshalwe === true) is saying its wrong syntax and the === does not go with the true-false statement.
after running this code:
`const display_shown = symbol.controllers.display.elements.shown;
const display_hidden = symbol.controllers.display.elements.hidden;
var Startshalwe = false;
const Sipsmith_Bottle = symbol.nodes.Sipsmith_Bottle;
parent.on(“show”, () => {
// Make sure we start from fully hidden
display_hidden.reset();
// Move to the shown state
display_shown.activate();
console.log(Startshalwe);
Sipsmith_Bottle.nodes.Label1_mp4.start();
Sipsmith_Bottle.nodes.Label1_mp4.on("finish", () => {
Sipsmith_Bottle.controllers.Picture.elements.Seen.activate();
Startshalwe = true;
console.log(Startshalwe);
});
});
if (Startshalwe === true){
symbol.controllers.start.elements.shall_we_show.activate();
console.log(Startshalwe);
};`
…
So I then tried a counter that will be the most helpful for when I reuse the code allowing me to have different things happen to depend on the number of times the video has been finished as I restart it and change the source to other videos playing however now the code says there is nothing wrong but it simply doesn’t work.
I tried console log and the log of the counter after the video has finished doesn’t display.
Here is the code i tried:
`const display_shown = symbol.controllers.display.elements.shown;
const display_hidden = symbol.controllers.display.elements.hidden;
var Startshalwe = 0;
const Sipsmith_Bottle = symbol.nodes.Sipsmith_Bottle;
parent.on(“show”, () => {
// Make sure we start from fully hidden
display_hidden.reset();
// Move to the shown state
display_shown.activate();
console.log(Startshalwe);
Sipsmith_Bottle.nodes.Label1_mp4.start();
Sipsmith_Bottle.nodes.Label1_mp4.on("finish", () => {
Sipsmith_Bottle.controllers.Picture.elements.Seen.activate();
Startshalwe++;
console.log(Startshalwe);
});
});
if (Startshalwe === 1){
symbol.controllers.start.elements.shall_we_show.activate();
console.log(Startshalwe);
};`