Hi Aaron,
It's usually best to broadcast and observe Mojo messages!
In a controller:
this.addObserver(mojo.Messaging.getTopic(“systemStatus”), “onPublish”, “ChangeSystemStatus”);
…and in your behavior/command:
mojo.Messaging.publish("systemStatus", 'theSystemIsDown');
The behavior aliased to "ChangeSystemStatus" will be called whenever it hears the message "systemStatus" being published.
If you're doing something more like trying to track a player's score onscreen, use models.
In your controller:
this.addObserver(mojo.Model.getReference("score"), "onNotify", "AnimateScore");
…and in your score-augmenting behavior:
mojo.Model.set("score", 123);
The behavior aliased to "AnimateScore" will be invoked whenever the "score" model is updated!
In both cases, the message itself, and the contents of the model, will be available to the invoked command/behavior through the handy requestObj.
Cheers,
Steven…