# Constructor throws number of args error

**URL:** <https://forum.kirupa.com/t/constructor-throws-number-of-args-error/272480>\
**Category:** Uncategorized\
**Created:** [October 5, 2008, 7:06pm UTC](https://forum.kirupa.com/t/constructor-throws-number-of-args-error/272480 "2008-10-05T19:06:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhnh](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@bhnh](https://forum.kirupa.com/u/bhnh)\
**Post date:** [October 5, 2008, 7:06pm UTC](https://forum.kirupa.com/t/constructor-throws-number-of-args-error/272480/1 "2008-10-05T19:06:30Z")

</div>

I’m a bit mystified here. In an .as file I have…

```auto
package(
 import flash.display.*;
 
 public class Dot extends MovieClip{
  public var foo:Number;
  public var nerb:String;
  private var gen:int;
 
  public function Dot(x,y:Number){
   this.x = x;
   this.y = y;
  }
 }
}

```

In my .fla I have…

```auto
var posX:Number = Math.random()*425 + 25;
var posY:Number = Math.random()*375 + 25;
var dot:Dot = new Dot(posX,posY);
addChild(dot);

```

… I get **[COLOR=red]1136: Incorrect number of arguments. Expected 0.[/COLOR]**  
Didn’t I specify that the constructor takes two arguments? :puzzle: Many thanks for any input.
