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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s