Strange Error #1063: "Argument count mismatch"

Hello! I am in the middle of a rather frustrating issue…here’s the applicable code!


var stageRef:Stage;
var keyHolder:KeyHolder;
var lowRandKey:Number;
var lowKeyArray:Array = [ //items in here];

public function generateKey()
{
	var randArray:Number = Math.ceil(Math.random()*4);
	
        if(randArray == 1) //lowercase
	{
		lowRandKey = Math.floor(Math.random()*lowKeyArray.length);
		keyHolder = new KeyHolder(stageRef, 370, -20, lowKeyArray[lowRandKey], randArray); 
        }
}

And this is the constructor from my KeyHolder class:


public var startX:Number;
public var startY:Number;
public var stageRef:Stage;
public var key:String;
public var kArray:Number;
		
public function KeyHolder(stageRef:Stage, startX:Number, startY:Number, key:String, kArray:Number)
{
	this.stageRef = stageRef;
	this.startX = startX;
	this.startY = startY;
	this.key = key;
	this.kArray = kArray;
}

The code runs just fine and everything is operational except it always throws this error:

“ArgumentError: Error #1063: Argument count mismatch on KeyHolder$iinit(). Expected 5, got 0.”

I don’t understand how it can say it got 0 when the game wouldn’t function without the 5 variables being successfully passed!

Any ideas?