All entries for Tuesday 01 April 2008

April 01, 2008

Cairngorm: Event Chaining with SequenceCommand

Writing about web page

I was talking to Sara earlier about this and said I’d write something about it briefly. Sometimes when using Cairngorm you find that you need to chain a number of events. An example might be when an application initialises and you need to chain a number of events/commands that perform a number of sequential tasks. Typically what happens is that you end up following the event/command model and fire the chain by sending an event from a command, then sending another from the target command, and so on. However, Cairngorm includes a class that can help; SequenceCommand:

By extending SequenceCommand, you can specify the event that should be broadcast to the controller (causing another command execution without a further user-gesture) when the current command has completed execution.

This is really handy, particularly for those runtime initialisation tasks, and it doesn’t break the standard Cairngorm model of Events firing Commands because you define a nextEvent property that triggers another Cairngorm Event (which triggers the next Command, and so on). David Tucker’s excellent guide to Cairngorm goes into more detail and has an example. There are also many examples of people extending the SequenceCommand concept to perform other tasks.


MXNA link



    Other blogs I like...

    Black Pepper Software

    Eismann-sf Go to 'Comments on: Design News for Web, Graphic Designers'

    Ted On Flex Go to 'Ted On Flash'



    Not signed in
    Sign in

    Powered by BlogBuilder
    © MMXXII