Skip to main content
Participant
November 27, 2021
Question

Help with code

  • November 27, 2021
  • 2 replies
  • 147 views

Hello everyone,

 

i have error with my code can anyone help me? discord is possible to

 

var tasopen = false;

 

//tas open pak draad

root.muur1.Tas.addEventListener("click",tasopen);

function tasopen()
{
root.muur1.Tas.removeEventListener("click",tasopen);
tasopen = true;
}

 

//muiscursor
createjs.Ticker.addEventListener("tick", handleTick);

function handleTick(e)
{
var g2l;
g2l = root.globalToLocal(stage.mouseX, stage.mouseY);
if(heefthamer == true)
{
root.Hamer.x = g2l.x;
root.Hamer.y = g2l.y;

}
if(heeftsleutel == true)
{
root.Sleutel.x = g2l.x;
root.Sleutel.y = g2l.y;

}
if(tasopen == true)
{
root.muur1.Draad.x = g2l.x;
root.muur1.Draad.y = g2l.y;

}

}

 

i have a error on my console:

 

createjs.min.js:12

Uncaught TypeError: h is not a function
at lib.tas.b._dispatchEvent (createjs.min.js:12)
at a.b.dispatchEvent (createjs.min.js:12)
at lib.Stage.b._dispatchMouseEvent (createjs.min.js:13)
at lib.Stage.b._handlePointerUp (createjs.min.js:13)
at lib.Stage.b._handleMouseUp (createjs.min.js:13)
at f (createjs.min.js:13)

    This topic has been closed for replies.

    2 replies

    Community Expert
    November 28, 2021

    Have you tried the feature code snippets? It helps with prewrittwn code for many actions. 

    kglad
    Community Expert
    Community Expert
    November 27, 2021

    tasopen is both a variable and a function causing the error.  fix that.