This content has been marked as final. Show 3 replies
We don't support this directly. However, notification of XML updates is supported, in two flavors. XMLListCollection provides Flex framework support including update events for operations on the XML and native player support. Take a look at the source code for mx.collections.XMLListAdapter.as for more details. The player supports notification of changes to XML natively and the Flex framework has some support for this via the XMLNotifiable interface and the XMLNotifier class (see mx.utils for these classes).
Thanks for the reply. I fooled around with XMLListCollection CollectionEvents but couldn't figure out how to extract the element,text or attribute node that was changed. My source XML is nothing like a list, its a large system adhoc configuration file. xdatalc:XMLListCollection = new XMLListCollection(new XMLList(xdata)) creates a list with a single item. The CollectionEvent.target is the top level node of my XML configuration file.
There isn't much out there on XMLNotifiable and XMLNotifier. I found
http://nondocs.blogspot.com/2007/04/mxutilsixmlnotifiable.html but will look at mx.collections.XMLListAdapter.as as you suggested.
I'm frantically implementing something in Flex2 and wanted to see if Flex3's XML support added mutation events. I'm using mutation events in python and they made my architecture incredibly simple.
Your second tip is EXACTLY what I needed!!! I even got it working in my MXML component, yah!
Here's a stripped down version of my custom FormItem that implements IXMLNotifiable and receives xmlNotifications. You can look at mx.collections.XMLListAdapter.as for a more complicated example (look at their xmlNotification method for more fun tricks).
Thanks for incredible tip.