You still have to go through the process of adding the listener and
defining the callback so its up to you. You could a) create an array, push
all the references to the text field, and loop through the array if you
are simply just showing the same value throughout. So that will work okay
if each textfield handles the info in the same way.

But if you have one text field that takes the value and converts it to say
global to local coords, another text field shows the local to global coord
- so they deal with the value differently, then I would say go for the
event dispatching. Thats a definite benefit: multiple items can listen and
handle the event the way they see fit.

> Hello There!
>
> As long as we are on the topic of EventDispatcher, I have another
> question that could really help me out.
>
> If I have multiple Controls (and variables) throughout my application,
> that were all tied to a SINGLE variable (that changes several times per
> second), could I use an EventDispatcher method - to dispatch an event
> whenever this specific variable changes, and have ALL those controls
> subscribed to that Event, update themselves with this new value?
>
> Right now, I have a Mouse position function (which runs every time the
> mouse moves), that updates a TON of TextFields scattered throughout my
> application with the mouse coordinates.  In my function, I have to go
> through Each and Every TextField instance, and update the .text
> properties.
>
> Is there a better way to accomplish this, like using the Event system?
> Or is this considered such a simple process, that manually setting the
> .text properties for a ton of controls is just the easiest way, rather
> than dispatching events?  (keep in mind, this variable gets updated many
> times per second)
>
> This topic has been on my mind for a LONG time now - and I would love a
> definitive answer on how to do this.
>
> Thanks in advance!
>
> Mike
> _______________________________________________
> [email protected]
> 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



_______________________________________________
[email protected]
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