Broken Flash Logo
Click an error type to choose an error.

mikeduguid

ø

Sentientv2

ø

joegodfrey

ø

sinsonido

ø

Aron18

ø

Ryan Stone

ø

John Nelson

ø

Alan

ø

Nojiveturkeyhe...

ø

aleejen

ø

Kellyf

ø

dangurtner

ø

kbowen

ø

agarcia

ø

ryan

ø

· · ·

1064

Runtime Error:Cannot call method _ as constructor.

Adobe’s Take:
Extracted methods are permanently bound to the object they are extracted from. Therefore, they can not later be called as a constructor. For example, the following creates function f() in Class A:

class A {
function f() {}
}


In the following code, extracting the function causes no error. However, creating a new instance of the function causes an error.

var a = new A()
var m = a.f // extract f, don't call it
m() // same as a.f()
new m() // causes this error


Login/Register to make a post
· · ·