I would also like to use patterns more than I do. It looks as thought the observer pattern might be the one in this case...

As your objects appear and disappear from your program they can register themselves. They pass a function to call when an update happens and this is added to the list. The list of observers' function are called to update them of the mouse position.

John

Joel Stransky wrote:
I'm trying to make design patterns a regular part of my process but
understanding them and knowing which one to use are proving to be a quite
different.
I'm working on a couple of classes. One class's job is to iterate over a
list of display objects and modify their scale and location based on mouse
position.
I want this class to be able to work with a runtime generated OR an
authortime generated display list.
I figure it's as easy as instantiating either a RuntimeChildren or
AuthortimeChildren class and passing it to the constructor of my
DisplayListUtility class.
Since it's so simple, does it even qualify as a design pattern and if so
which one?


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to