The xml that you've shown consists of all attributes, that is value
pairs inside a tag. Each node has a attributes property. Here is a small
snippet that demonstrates accessing attributes.
private function loadProblems(xFileName:String):Void
{
var sLessonPath = this.theLessonPath; // _root.lesson_path;
var pathedFileName:String = sLessonPath + xFileName
xmlFile = new XML();
xmlFile.ignoreWhite = true;
xmlFile.onLoad = mx.utils.Delegate.create(this, fetchLessonFiles);
xmlFile.load( pathedFileName );
return;
}
public function fetchLessonFiles():Void
{
var cFileNum:Number = 1; // counter
var cFileID:String;
cFileID = unescape(xmlFile[cFileNum].attributes.fileName);
}
--
Carl Welch
http://www.carlwelch.com
[EMAIL PROTECTED]
On 3/14/07, Andrew Wright <[EMAIL PROTECTED]> wrote:
<XMLNode>.attributes.imageID
<XMLNode>.attributes.img
<XMLNode>.attributes.text
etc
> Hi coders,
>
> I just started working on a new project that is requiring me to handle
> an xml format that I haven't had to deal with yet.
>
> Here is an example of what it looks like:
>
> <image imageID="halLogin" img="hal.png" text=""
> Font="Black,8,Regular,AlignLeft" onPanel="true" xPos="0.25"
> yPos="0.112" />
>
> I'm used to parsing xml that looks like this:
>
> <something>
> <blah>"foo"</blah>
> </something>
>
> How do I parse xml that looks like the first example with multiple
> values inside of a single node?
>
> Thanks.
_______________________________________________
[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
_______________________________________________
[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