Skip to main content
Participant
May 18, 2021
Answered

[Error] 1061: Call to a possibly undefined method bind.

  • May 18, 2021
  • 2 replies
  • 1680 views

Hello, 

Forgive me if this is a dumb question. So I just started to use Animate, and followed a turorial right here.

https://www.youtube.com/watch?v=Y9lxYi-EU0g

I was trying to make a carousel with next and previous buttons. And I created from code snippet an action script like this.

this.prevBtn.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this));

function fl_ClickToGoToAndStopAtFrame()
{
	this.gotoAndStop(1);
}

This is almost the default code snippet, except for that I changed the frame number to fit in my number of frames. 

However, I keep getting this error: 1061: "Call to a possibly undefined method bind." and I don't know where to start debugging. 

I would appreciate any suggestions. Please help.

This topic has been closed for replies.
Correct answer JoãoCésar17023019

Hi.

 

It's probably because you're using JavaScript in an AS3 document.

 

Go to File > Convert To > HTML5 Canvas so that Animate will convert all visuals to HTML5, but all coding will be commented out. You're gonna have to uncomment your code or rewrite it.

 

But if what you want is really AS3, then make sure you're using AS3 snippets.

 

Please let us know if fixes the problem.

 

Regards,

JC

2 replies

Colin Holgate
Inspiring
May 18, 2021

Are you working in an HTML5 Canvas FLA? If you're using an ActionScript 3.0 FLA you would see that error.

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
May 18, 2021

Hi.

 

It's probably because you're using JavaScript in an AS3 document.

 

Go to File > Convert To > HTML5 Canvas so that Animate will convert all visuals to HTML5, but all coding will be commented out. You're gonna have to uncomment your code or rewrite it.

 

But if what you want is really AS3, then make sure you're using AS3 snippets.

 

Please let us know if fixes the problem.

 

Regards,

JC

Participant
May 18, 2021

Hello, 

Thanks for the very quick reply. It was correct! I changed it to html canvas and rewrote the code and my project works fine now. 

When I Ctrl + Enter now it plays on my browser instead of the window like in the tutorial, but I guess it's some minor difference. 

Anyway thank you.

Best regards,

Thang

JoãoCésar17023019
Community Expert
Community Expert
May 18, 2021

That's great! You're welcome.

 

Yeah, the test feature in HTML5 Canvas documents always open a browser.

 

Regards,

JC