There must be some nuance I don't get. What about:
<mx:ArrayCollection collectionChange="myFunction" /> ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Richard Rodseth Sent: Wednesday, August 13, 2008 5:28 PM To: [email protected] Subject: Re: [flexcoders] Observing collections Hi Alex, Observe is designed to be used in MXML (it's even billed as the "world's smallest tag") and that's how I use it. http://weblogs.macromedia.com/paulw/archives/2006/05/the_worlds_smal.htm l <http://weblogs.macromedia.com/paulw/archives/2006/05/the_worlds_smal.ht ml> As it happens it doesn't implement IMXMLObject. In any case, since it uses regular binding expressions for the "source" property, I believe it has the limitation-by-design I referred to. On Wed, Aug 13, 2008 at 5:17 PM, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Never used Observe, but if it implements IMXMLObject or you subclass and do so, then you can use it in MXML ________________________________ From: [email protected] <mailto:[email protected]> [mailto:[email protected] <mailto:[email protected]> ] On Behalf Of Richard Rodseth Sent: Wednesday, August 13, 2008 4:16 PM To: [email protected] <mailto:[email protected]> Subject: [flexcoders] Observing collections For some reason I have an aversion to adding event listeners in ActionScript, favouring binding expressions and the Observe tag from Adobe Consulting. Not sure how rational this is, but there you have it. Binding is just so damn elegant. However, collections are a problem. It seems that so often you want to update something if either the collection itself or its contents changes, and you don't really care about the details of the change. I suppose if you're a DataGrid watching its dataprovider you do care and can minimize updates, but in many of the use cases I've encountered, that's not the case - my observer is going to do something with the whole collection (or maybe I've just been lazy about exploiting possible optimizations). Is there anything like the Observe tag that can be instantiated in MXML and can trigger a function call on a COLLECTION_CHANGE event?

