Sounds like you want to wrap the variable(s) in a class and have that class
broadcast events that your components can listen for and react to.

I haven't gotten to the chapter yet, but I think Moock's  Essential
Actionscript 2.0 describes it in Chapter 352 (Observer Design Pattern)

Alternatively, you might do it by using mx.events.EventDispatcher in your
wrapper class.

- phaedrus

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Anderson
Sent: Friday, May 26, 2006 1:22 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Can Variables have listeners?

Hello All,

I have a ton of components scattered throughout my application, and most
of them react to changes of a specific variable.

It's getting really old, having to manually write code - that updates
all these controls with the new value of a specific variable, when a
specific variable changes.  It would be nice to just have ONE function,
that propagates all the changes to all my controls, and then have an
active listener applied to a variable which automatically triggers that
specific function.

Am I overlooking something, or is there a better way to do something
like this?

Thank you all in advance, for any suggestions you can throw my way.

Mike
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to