if you have a reference to the ArrayCollection you can do

  collection.addEventListener(CollectionEvent.COLLECTION_CHANGE,
collectionChange);

collectionChange will then get notified for different kinds of updates
happening on the collection instance (see mx.events.CollectionEventKind
for the available kinds)

Dirk. 

> -----Original Message-----
> From: flexcoders@yahoogroups.com 
> [mailto:[EMAIL PROTECTED] On Behalf Of Sebastian Feher
> Sent: Thursday, May 10, 2007 6:46 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] bindSetter on an ArrayCollection
> 
> Hi,
> 
> I ran into a situation where I need to be notified about 
> items being removed or added from/to a node that has 
> children:ArrayCollection in a hierarchical structure. I know 
> the deep binding works as I can see my model changes picked 
> by the Tree control.
> 
> [Bindable]
> private var myData :ArrayCollection = new ArrayCollection();
> 
> ...
> 
> // trace(ChangeWatcher.canWatch(myData.getItemAt(0).children.getItemAt
> (0), "children")) -> true
> 
> BindingUtils.bindSetter(dataUpdated, myData.getItemAt 
> (0).children.getItemAt(0), "children"); /* -> public var 
> children :ArrayCollection = new ArrayCollection();*/
> 
> ...
> 
> public function dataUpdated(value:ArrayCollection):void
> {
>       trace("--- updated ---");
> }
> 
> is being called only on assignments to children.
> 
> How do I bind on an ArrayCollection? I would like to catch 
> the items added & removed to the collection.
> 
> Regards,
> Sebastian
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
> 
> 
> 
> 

Reply via email to