Robot Legs & FlexUnit4 – EventDispatchers wo/Injector

This should be obvious, but in case you have a brain fart like I did earlier. If your looking to test a Robot Leg Actor. And you want to listen for events coming out of the Actor. Here is a easy way to do it.

The main purpose of this is to be able to test a individual actor. Such as a web service to make sure it as a individual is performing correctly.


public var myActor:CoolActorClass;

public function setupActor():void {
	myActor = new CoolActorClass();
	myActor.eventDispatcher = new EventDispatcher();

And if your using Joel’s Modular Utility. You can do something like this.


public var myActor:CoolModularActorClass;

public function setupModuleActor():void {
	myActor = new CoolModularActorClass();
	myActor.eventDispatcher = new EventDispatcher();
	myActor.moduleEventDispatcher = new ModuleEventDispatcher();

Now you can perform your test as if it’s running in a full blown RL Application.