Hi Verge’rs,
I’m using:
v3d.puzzles.procedures[‘SetScreenScale’]();
to trigger a procedure. I’m using it in another function as well, It works fine there, but here it say:
Cannot read properties of undefined (reading ‘procedures’)at myFunction
Here is my function (in the body):
<script >
var x = window.matchMedia(“(max-aspect-ratio: 5/5)”)
myFunction(x) // Call listener function at run time
x.addListener(myFunction) // Attach listener function on state changes
function myFunction(x) {
var element2 = document.getElementById(“Configmenu”);
if (x.matches) { // If media query matches
document.body.style.backgroundColor = “yellow”;
document.getElementById(“page3DmenuHor”).appendChild(element2);
v3d.puzzles.procedures[‘SetScreenScale’]();
} else {
document.body.style.backgroundColor = “pink”;
document.getElementById(“page3Dmenu”).appendChild(element2);
v3d.puzzles.procedures[‘SetScreenScale’]();
}
}
</script>
Is this a bug or am I doing something wrong??,…probably the last
found out: has to do with the loading porcedures of the page:
calling procedures from js
Technical Artwork Specialist@TBL.nl