You are supposed to use the XMLListCollection class which broadcasts events.  There isn't a way to bind or listen directly to an XML or XMLList object without using XMLWatcher, XMLNotifier or IXMLNotifiable which are all not documented.

- Dan

On 11/7/06, tobiaspatton <[EMAIL PROTECTED]> wrote:
Hello list;

Is there way to use the BindingWatcher class to detect changes to
nodes in an XML object? So far, I've not been able to get this to
work.

I've looked at the compiler-generated code that implements this sort
of binding for MXML files, but it uses classes like XMLWatcher that
are in the mx:internal namespace. I understand that developers are
not meant to use these classes.

Thanks.
Tobias.

Here's the code I'm using for my tests:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
        creationComplete="OnCreationComplete()">

        <mx:Script>
                <![CDATA[
                        import mx.binding.utils.ChangeWatcher;

                        private function OnCreationComplete() : void
                        {
                                _watcher = ChangeWatcher.watch(
this, [ "x1", "leaf[ 0 ]" ], OnChange );
                                trace( _watcher.isWatching() );
                        }

                        private  function OnChange( change :
Object ) : void
                        {
                                trace( "Change" );
                        }

                        private var _watcher : ChangeWatcher;
                ]]>
        </mx:Script>

        <mx:HBox>
                <mx:Label id="l1" text="{x1.leaf [ 0 ]}"/>
                <mx:TextInput id="ti1"/>
                <mx:Button label="Change" click="x1.leaf[ 0 ] =
ti1.text"/>
        </mx:HBox>


        <mx:XML id="x1" format="e4x" xmlns="">
                <root>
                        <leaf>Initial Value 0</leaf>
                        <group1>
                                <leaf>Initial Value</leaf>
                                <leaf>Initial Value 2</leaf>
                        </group1>
                </root>
        </mx:XML>
</mx:Application>





--
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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto: [EMAIL PROTECTED]
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/



__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to