Copy link to clipboard
Copied
Hello and thank you all in advance
I'm using Animate 20.0.5.1
Doing a canvas interactive animation, it works well but I get this error:
TypeError: undefined is not an object (evaluating 'c.tickEnabled')
Which I don't understand given that it is not from a function of mine. Luckily this does not prevent my canvas from running well. I am only concerned with understanding why it happens.
I was able to find what causes it but I could not interpret what it is due to. I will try to explain it in short.
I have a MovieClip called to play as a transition between 2 frames, at the middle of the MC animation, it calls for a gotoAndPlay at the main timeline:
Main Timeline / Frame 114 / CODE:
root.transition = function(aCualVamos)
{
root.selectedSection = aCualVamos;
root.transition_mc.gotoAndPlay(2);
}
root.clk_01.addEventListener("click", root.transition.bind(this, "s1"));
The action in the middle of "transition_mc" animation:
this.parent.gotoAndStop(root.selectedSection);
The console error appears exactly after running this line
Action Frame 126: label: "s1"
root.back_btn.addEventListener("click", root.transition.bind(this, "map"));
BUT!
When I click at the back_btn, who calls the same function, same mc, same line of code before has shown the error, this new call does not show any errors!?
If I call again the first button, the error will appear again.
Here is a link where you can see it working DEMO CANVAS
And here is the fla file: ERROR.FLA
Thank you for taking the time to read my question
Copy link to clipboard
Copied
the first error i see is your "click" listener. try:
root.transition.bind(this)("s1");
Copy link to clipboard
Copied
Supplying optional arguments to bind() is valid.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Function/bind
Copy link to clipboard
Copied
@ClayUUID, thanks. i didn't know.