Good point.

One optional tweak:

var xml:XML = new XML();
xml.ignoreWhite = true;
xml.parseXML(someTextVar);
xml.onLoad = function(success:Boolean):Void {
        if (this.status == 0) {
                trace("Success!");
        } else {
                trace("Error in XML! Code: " + this.status);
        }
}

The scope should probably be "this" instead of "xml" in this case.
―
Mike Keesey

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Ray Chuan
> Sent: Saturday, October 07, 2006 2:21 AM
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] Error check for parseXML()
> 
> Hi,
> you should put the conditional in a callback, because when execution
> reaches the conditional xml parsing might not have finished parsing.
> 
> var xml:XML = new XML();
> xml.ignoreWhite = true;
> xml.parseXML(someTextVar);
> xml.onLoad = function(success:Boolean):Void {
>       if (xml.status == 0) {
>               trace("Success!");
>       } else {
>               trace("Error in XML! Code: " + xml.status);
>       }
> }
> 
> Note that the "success" argument can be ignored if you're using
> functions like parseXML(), because it's got to do with the success of
> loading a document using XML.load() or XML.sendAndLoad().
> 
> On 10/7/06, Mike Keesey <[EMAIL PROTECTED]> wrote:
> > Use the XML.status field.
> >
> > var xml:XML = new XML();
> > xml.ignoreWhite = true;
> > xml.parseXML(someTextVar);
> > if (xml.status == 0) {
> >         trace("Success!");
> > } else {
> >         trace("Error in XML! Code: " + xml.status);
> > }
> >
> > ―
> > Mike Keesey
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED]
[mailto:flashcoders-
> > > [EMAIL PROTECTED] On Behalf Of Mendelsohn, Michael
> > > Sent: Friday, October 06, 2006 6:50 AM
> > > To: Flashcoders mailing list
> > > Subject: [Flashcoders] Error check for parseXML()
> > >
> > > Hi list...
> > >
> > > According to the help docs,
> > > public parseXML(value:String) : Void
> > > doesn't return an integer or anything to indicate successful
parsing
> > of
> > > the xml.  How can I be certain that I've passed in some error free
xml
> > > and it was able to parse?
> > >
> > > Thanks,
> > > - Michael M.
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > [email protected]
> > > 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
> >
> > _______________________________________________
> > [email protected]
> > 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
> >
> 
> 
> --
> Cheers,
> Ray Chuan

_______________________________________________
[email protected]
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