I have 4 buttons assigned to run 4 different functions
. Seen below
document.getElementById("buttonOne").addEventListener("click", functionOne);
document.getElementById("buttonTwo").addEventListener("click", functionTwo);
document.getElementById("buttonThree").addEventListener("click", functionThree);
document.getElementById("buttonFour").addEventListener("click", functionFour);
I have another function,functionFive
, that is not controlled by any button.
All of these functions set parameters on a 3D object when the given button is clicked. Clicking button one runs functionOne
, setting a specific set of parameters. If those parameters are set from functionOne
and I click button four, I want functionFive
to be run.
If those parameters from functionOne
are not set when button four is clicked, I want functionFour
to run.
To clarify, I only want this functionFive
to run if functionOne
has already run and its parameters are set.
Can someone help me write this script? I've rewritten my question to fit my exact need. My original description was condensed to try and simplify it so it wouldn't be this long.