Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
May 18, 2021 May 18, 2021

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.

TOPICS
ActionScript , Code , Error , How to
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 18, 2021 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

Translate
Community Expert ,
May 18, 2021 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 18, 2021 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 18, 2021 May 18, 2021
LATEST

That's great! You're welcome.

 

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

 

Regards,

JC

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 18, 2021 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines