import mx.utils.Delegate;
var xmlData:XML;
function xmlLoadHandler(success:Boolean) {
    trace("xmlLoadHandler: "+success);
    trace(xmlData);
    if(success) {
        var totalPics:Number = 
xmlData.firstChild.childNodes[0].childNodes.length;
        trace("    - totalPics: "+totalPics);
    }else{
        trace("    - failed to load xml data.");
    }
}
xmlData= new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = Delegate.create(this, xmlLoadHandler);
xmlData.load("gallery.xml");

regards,
Muzak

----- Original Message ----- 
From: "Omar Fouad" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Sunday, July 08, 2007 1:44 AM
Subject: Re: [Flashcoders] XML loading and parsing problem


> Fruber this code is still not working.. :(
>
> var xmlData:XML = new XML();
>
> xmlData.onLoad = function (success) {
>    if(success) {
>        trace("xml Loaded");
>        proceed(this);
>    }else{
>        trace("xml Not Loaded");
>    }
> }
> xmlData.load("gallery.xml");
>
> proceed = function (gallery:XML) {
>    totalPics = gallery.childNodes[0].childNodes[0].length;
>    trace(total);
>
> }
>
> total traces undefined
>
> where gallery.xml is
>
> <?xml version="1.0"?>
> <gal>
>    <catgory>
>        <pic link="1.jpg" code="a1" />
>        <pic link="2.jpg" code="a2"/>
>        <pic link="3.jpg" code="a3"/>
>        <pic link="4.jpg" code="a4"/>
>    </catgory>
>
> </gal>
>
> something else missing????
>
>
>> --
>> Omar M. Fouad - Digital Emotions
>> http://www.omarfouad.net
>>
>> +2010 - 2346633 - +2012 - 2644441
>
>
>
>
> -- 
> Omar M. Fouad - Digital Emotions
> http://www.omarfouad.net
>
> +2010 - 2346633 - +2012 - 2644441
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
> 


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to