Detecting keyboard presses on the stage from an external class?

Hello there! I am working on a small section of my game and am attempting to detect key presses from an external class but I cannot get it to work. This code worked just fine when within the document class but now it’s unresponsive. I’m not getting any errors, simply no activity whatsoever.

Here’s the applicable code:

My document class:


package 
{
	import flash.display.MovieClip;
	
	public class Engine extends MovieClip 
	{
		public var itemTest:ItemTest;
		
                public function Engine() 
		{
			itemTest = new ItemTest(this);
		}
	}
}

My external class:


public function Abilities(ref:*)
{
	stageRef = ref;
	Keys();
}

public function Keys()
{
	stageRef.addEventListener(KeyboardEvent.KEY_DOWN, checkKeys, false, 0, true);
}
		
public function checkKeys(keyboardEvent:KeyboardEvent)
{
	if ( keyboardEvent.keyCode == 83 ) // The "s" key.
		downPressed();
		trace("down!"); 
			
	if ( keyboardEvent.keyCode == 87 ) // The "w" key.
		upPressed();
		trace("up!");
}

I’m pretty sure it has to do with my stage reference but I have no idea how to go about making it functional again.

Any ideas?