Is it possible to change the color of an element which takes place in a scene (exemple : scene 1), clicking on a button which takes place in an other scene (scene 2) ? How to link the two elements if they are not in the same scenes ?
I write that in javascript but it works only when elements takes place in the same scene
There are certainly several approaches here. One option would be to use a persistent symbol: Give the rectangle a class name (e.g. 'box'). Turn the rectangle into a persistent symbol. You can now change the color of the rectangle within any persistent symbol in any scene using the class:
Thanks for your answer.
I use the custom behavior to link the 2 buttons located in 2 different scenes.
In the scene 1, I define a custom behavior "changecolor"
and when you clic on the button in the scene 2, it makes the custom behaviour happened.
I made that for 4 buttons located in the scene 1
// Récupérer le bouton par son identifiant
var monBouton = document.getElementById("buttondef");
// Désactiver le bouton
monBouton.disabled = true;
// Modifier le style pour le rendre visuellement indisponible
monBouton.style.opacity = 0.5; // Exemple : réduire l'opacité du bouton
monBouton.style.border = "1px solid rgba(0, 0, 0, 0.5)"; // Réduire l'opacité du contour