I tend to go with event dispatchers, as you can move the child wherever you like. However, you need to document the available events, somehow.
If you were to pass in an object to refer to (other than calling 'parent') I would recommend something based on an Interface implementation, for portability, as well.
--
: : ) Scott
Helping your grandma on the interweb
at: http://blog.criticalpile.com
If you were to pass in an object to refer to (other than calling 'parent') I would recommend something based on an Interface implementation, for portability, as well.
On Mon, Jul 21, 2008 at 11:58 PM, Chuck Preston Jr. <itsmechuckjr@...> wrote:
Hi group,
Is there a best practice for communicating property changes from an object to its parent?
Specifically, is it better to have the object broadcast it's change via dispatchEvent, or is it
better to have the parent ask the object for the value when it's needed, via a getter function?
Or, is it just a personal style kind of thing.
I've got a video object that gets paused and restarted and seeked (suck?) to different frames,
and I need to communicate any changes to the parent app.
Thanks,
Chuck
--
: : ) Scott
Helping your grandma on the interweb
at: http://blog.criticalpile.com