Search code examples
actionscript-3flashreserved-wordsclass-names

Is "World" reserved Class name in AS3?


Does anyone knows something about "World" being reserved or built in class with that name? when I try to construct the World class I've created it throws compile error:

1136: Incorrect number of arguments.  Expected 2.

But I've million times checked, there are no arguments expected at all, all package naming, variable types.. everything is correct, but it throws that stupid error. :/ Try it on your own and you will see that it does.. or I'm stupid?

When I try to call init function in the World class it throws this one:

1061: Call to a possibly undefined method init through a reference with static type World.

Grr..


Solution

  • I have had this same problem. I think it is reserved as of FlashPlayer 10 (possibly 10.1, but can't be sure). I had to work around it by using my full package name when referencing my World class.

    var myWorld:com.foo.World = new com.foo.World();
    

    Ugly, but it works!