I am sure there will be plenty of suggestions, but it sounds like you
need some sort of static point of access for your sounds.  There are
few approaches that I would try:

Make a SoundManager Singleton class that extends the EventDispatcher.
 That way if you make use of the basic Flex events, you can then have
the soundManager instance assign its event handlers.

As for using the Cairngorm class, I think that could also be a good
idea.  I have written a little blog on it here:
http://jwopitz.wordpress.com/2007/03/01/

I would not start having the model do any command-ish activities since
that is not its responsibility.  And I would not make it a view-type
since, well, its not a view, its a sound.  

Hope that helps.

--- In [email protected], "hank williams" <[EMAIL PROTECTED]> wrote:
>
> I have a class that is basically a sound server. It both generates
> events - like "sound #1234 is finished" and receives commands like
> "start playing sound #4567".
> 
> My problem is that I am not sure where to put this in the cairngorm
universe.
> 
> If I were to put it in the model, thats kinda wierd since it generates
> events, and models dont ususally generate cairngorm events. One
> thought I had was not to have it generate events, but to use binding
> to get information out of the object, but events really are better
> since it may be playing multiple sounds and events allow me to specify
> that multiple things are happening. Binding would be less clean
> because my binding subscribers would have to bind to an array since
> any number of sounds may be in play at one time.
> 
> If I were to make the class a view, thats wierd because views dont
> generally get modified by cairngorm events.
> 
> Of course the third way is just to use standard AS3 events - which is
> the way it currently works - but the architecture of commands in
> cairngorm is so clean with a class for each command that it makes it
> really easy to read the code.  So if I can, I would like to use the
> cairngorm command structure for this piece if I can make it work.
> 
> Any thoughts greatly appreciated.
> 
> Hank
>


Reply via email to