import ginner.GDispatcher
class flashdb.utils.ParserXML extends XML {
var target:MovieClip
var xmlobj:XML
var lista:Array
var ref:Object
public var addEventListener:Function;
public var removeEventListener:Function;
private var dispatchEvent:Function;
function ParserXML (targ:MovieClip, list:Array,
URI:String) {
if (!arguments) {
return;
}
GDispatcher.initialize(this);
target = targ
lista = list
xmlobj = new XML();
xmlobj[“ref”] = this;
trace (this);
xmlobj.ignoreWhite = true;
xmlobj.onLoad = onLoad;
xmlobj.load(URI);
}
function onLoad (success) {
if (success) {
var nodeXML:XML = this;
if (nodeXML.firstChild.childNodes.length!=null) {
//trace (nodeXML.childNodes[0]);
//trace (nodeXML.childNodes[1]);
//var Childvalue = “childNodes[1]”;
for (var i:Number = 0; i<nodeXML.firstChild.childNodes.length;i++){
var obj:Object = new Object()
for (var j in nodeXML.childNodes[1].childNodes[i].attributes) {
obj[j] = String(nodeXML.childNodes[1].childNodes[i].attributes[j]);
}
this.ref.lista.push(obj)
}
this.ref.dispatchEvent({target:this.ref.target, type:’onloadFinished’});
}
}else{
this.ref.dispatchEvent({target:this.ref.target, type:’onloadError’});
}
}
}
lots of useful things can be found here. 😉
Somehow i missed the point. Probably lost in translation 🙂 Anyway … nice blog to visit.
cheers, Thallium.