I created this demo using concepts for the objects I use the most.
I put this download on here to save me the trouble of re-coding or
stripping things out of projects I have created in the past.
The two factories are actually similar to the point they can
both extend the same thing so I don't want anybody asking me
why I did not just do it in the first place.
I have other versions I hope to add in the future
Anybody who is looking at this should feel free to download all
the files. I would also like to see or hear about any improvements
someone has made.
What I am doing here is putting a factory onto a Composite View. In addition
to creating the objects and placing them on the view, the factory
also registers the objects as subscribers to the Model by adding them
as children of a Composite View.
Basically it consists of two types of objects that can be selected.
When they are selected they notify the controller to update the Model.
Once the Model is updated the objects then "ask" the model which
Object is selected. If they are the selected object then they change
one of their display properties.
Everything combined can be seen here:
http://www.ericschleeper.com/mvcver1/
The zipped file is located here:
http://www.code.ericschleeper.com/samples/The_Works.zip
It includes swfobject, which is currently hosted on Google:
http://code.google.com/p/swfobject/
and also swfaddress
http://www.asual.com/swfaddress/
Plus, CompositeView.as and ComponentView.as are basically straight out of
O'Reilly's ActionScript3.0 Design Patterns: