Sequencing multiple commands

24 December, 2006

In your cairngorm Flex 2 application you may require to string a sequence of commands together. This may occur in your application’s initialization process or in the view from a user gesture.

For example, in the case of an e-commerce application on initialization you may be required to get all categories, sub-categories related to a category and the products related to a sub-category all in one process.

In cairngorm each command requires an event to be fired in order to execute the command. Now where you create that next event to be fired is usually in the subsequent command, prior to setting it to that command’s nextEvent property.

Perhaps this approach may not be suitable depending on your commands (as in one my cases) so i created a utility for chaining events together so that a sequence of events can be fired at the developer’s desire.

To demonstrate a scenario of the usage of this utility i have created a small example (click here and right-click to download source) and an illustration of the example.

Event Chaining Diagram

What i’ve done is create a sub-class of CairngormEvent which has a public property called nextChainedEvent.
Then I’ve create a utility class called EventChainFactory with a method chainEvents, which accepts an array of ChainEvent instances as its only parameter with each event in the array ordered in the order you want your sequence of events fired in. The method returns a ChainEvent instance with each subsequent event set to the next event’s nextChainedEvent property.

Enjoy and dont hestitate to improve it.

Regards,
Bjorn Schultheiss

Advertisements

FlashDevelop 2.0 Complete!

5 October, 2006

Just posted on the OSFlash Mailing list
Good work guys!
I will definitely give it a go.

———-

We did it!

The FlashDevelop team is proud to announce the Final 2.0 release. We hope you definitely enjoy working with FlashDevelop all day long 🙂

This is really a community achievement, so “merci” to all the FlashDevelop users and contributors around the world: your support means a lot for us.

Download FlashDevelop 2 Final:
http://www.flashdevelop.org/community/viewtopic.php?t=1001

To be continued…

– the FD Team

Awesome remoting alternative!

27 September, 2006

This email just appeared on flexcoders:

“””

Hello 🙂

You can use my framework OpenSource “Vegas” : http://osflash.org/vegas

NB : you can find my project too in google code :
http://code.google.com/p/vegas/

With this extension ASGard : http://osflash.org/asgard

In ASGard you can find asgard.net.remoting package :

AS2 version :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/src/asgard/net/remoting/
AS3 version :
http://svn1.cvsdude.com/osflash/vegas/AS3/trunk/src/asgard/net/remoting/
SSAS version (FMS) :
http://svn1.cvsdude.com/osflash/vegas/SSAS/trunk/src/src/asgard/net/remoting/

You can find example to use this implementation in AS2 example :
http://svn1.cvsdude.com/osflash/vegas/AS2/trunk/bin/test/asgard/net/remoting/

EKA+ 🙂

“”””

He’s a cool dude,
the code’s all free and available for use.
These tools are awesome.