Single BS player. basically I have some images split into 3 vertical slices. each set is in its own zone. The idea is users can scroll through each slice stack to get 3 matching and complete the full image.
As each slice is displayed it sets its varaibale to 1.
So if a1=1, a2=1, a3=1 the image is complete and I want to trigger a zone message to un-hide the congratulations zone.
I have this java script and a local html page linked to an html widget but I'm not getting any zone messages.
Here's the script:-
// Function to check if all slices match
function checkMatch() {
console.log("checkMatch is running...");
// Image slice variables
const a1 = 1; // Example values: Set dynamically in your code
const a2 = 1;
const a3 = 1;
const t1 = 0;
const t2 = 0;
const t3 = 0;
const r1 = 0;
const r2 = 0;
const r3 = 0;
// Check for Blue match
if (a1 === 1 && a2 === 1 && a3 === 1) {
console.log("Condition met for blueVT");
sendZoneMessage("blueVT");
}
// Check for Green match
if (t1 === 1 && t2 === 1 && t3 === 1) {
console.log("Condition met for greenVT");
sendZoneMessage("greenVT");
}
// Check for Yellow match
if (r1 === 1 && r2 === 1 && r3 === 1) {
console.log("Condition met for yellowVT");
sendZoneMessage("yellowVT");
}
}
// Function to send zone message
function sendZoneMessage(message) {
var port = new BrightSign.MessagePort(); // Create a MessagePort instance
port.send(message); // Send the message
console.log(`Zone message sent: ${message}`); // Debugging log
}
// Call checkMatch periodically
setInterval(checkMatch, 500); // Check matches every half second
Any help greatly accepted, happy to share any files, using latest BAconnected and firmware on the XT1143 player