For instance using this code on each seperate button (but pointing to different symbols obviously)


#1

const Tap_Dripping = symbol.symbolDefinitions.Tap_Dripping();

var photoFeatureArray = [Tap_Dripping];

var randomNumber;
var previousNumber;

parent.on(“pointerdown”, (e) => {
// Runs when pointerdown occurs on the parent node
// The argument e contains useful info about this event:
// https://docs.zap.works/studio/scripting/reference/object/events/pointerdown/
do {
randomNumber = Math.floor(Math.random() * 2);
}
while (randomNumber == previousNumber);

previousNumber = randomNumber;

photoFeatureArray[randomNumber].display();
symbol.hide();

});
Tap_Dripping.on(“close”, () => {
// Runs when the Happy_LegoFace symbol is closed
// Show the current symbol, the parent symbol
symbol.show();
});


split this topic #2

A post was merged into an existing topic: Create a menu on opening page


closed #3