Friday, April 6, 2007

mx.utils.IXMLNotifiable

This interface defines the definition of the listener for XML and XMLList objects that are watched using mx.utils.XMLNotifier. The definition is

function xmlNotification(currentTarget:Object, type:String, target:Object, value:Object, detail:Object):void;

It appears the the listener that calls xmlNotification bubbles up the event from the XML object (node, attribute or text) up the XML hierarchy until it reaches the XML object that registered the listener.

Description:
function xmlNotification(currentTarget:Object, type:String, target:Object, value:Object, detail:Object):void {
// current target appears to be the object that registered the watcher, but don't quote me on that.
// target appears to be XML object that is being acted upon.
switch(type) {
case "attributeAdded":
// name of attribute == value
// value of attribute == detail
case "attributeChanged":
// name of attribute == value
// old value of attribute == detail
case "attributeRemoved":
// name of attribute == value
// value of attribute before removal == detail
case "nodeAdded":
// added node == value
case "nodeChanged":
// node == value
// copy of old node == detail
case "nodeRemoved":
// removed node == value
case "textSet":
// next text == value
// old text == detail
}
}

1 comment:

Anonymous said...

E4X node can fire more events than handled in framework:
http://www.docsultant.com/site2/articles/flex_internals.html#xmlNotify

Just my 2c...

--
Thanks,
Vadim.

"Flex", "ActionScript" and possibly "MXML" are probably trademarks of Adobe Systems Incorporated.
"Adobe" is a trademark of Adobe Systems Incorporated.
This site is in no way endorsed or sponsored by Adobe Systems Incorporated.
Content Copyright © 2007 Daniel Freiman.
Site Design Copyright by its copyright holder.
The Flex Non-Docs reserves the right to remove comments for any reason.
All ActionScript and MXML code (and ONLY ActionScript and MXML code) on this website is available under the MIT License.