Here's XML2AS as an AS2 static class for her pleasure.
Steve,
I've used a lot of XML parsers, and have never found one I've been fully
satisfied with. I've seen you post this a few times before, but I couldn
never get yours working right, so I thought I would try again. I like
the simplicity
Hey Jason,
You don't say .nodeValue - the nodeValue is just the first item in the
Array. Technically, it's a String object.
Here is a sample class that parse that entire xml and traces it out.
In your timeline just put:
import com.Test;
var test:Test = new Test();
And you'll see it trace the
Leadership Development
eTools Multimedia Team
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Steven Sacks | BLITZ
Sent: Friday, March 16, 2007 1:58 PM
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] xml parse question - Steve
Nevermind. I found this in one of my many flash books:
myAttributes = this.firstChild.childNodes[0].childNodes[0].attributes;
for(attributes in myAttributes){
trace(attributes+ : +myAttributes[attributes]);
}
On 3/14/07, Carl Welch [EMAIL PROTECTED] wrote:
What if I don't know what the
What if I don't know what the names are going to be? How can I check
how many attributes are in a node? is there anything like
XMLNode.attributes.length (I know that's wrong...) so I can loop
through and find out their names?
--
Carl Welch
http://www.carlwelch.com
[EMAIL PROTECTED]
On 3/14/07,
all the attributes are in the attributes object, so you can just do a
for...in loop and grab them all.
example:
for(a in xObj.attributes) {
obj[a] = xObj.attributes[a];
}
On Mar 15, 2007, at 12:19 AM, Carl Welch wrote:
What if I don't know what the names are going to be? How can
Here's XML2AS as an AS2 static class for her pleasure.
class com.stevensacks.data.XML2AS
{
public static function parse(n, r)
{
var a, d, k;
if (r[k=n.nodeName] == null) r = ((a=r[k]=[{}]))[d=0];
else r =
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;
and then
reverse order, when the for is done.
Andrew
-Original Message-
From: Carl Welch [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 15, 2007 3:04 AM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] xml parse question
Nevermind. I found this in one of my many flash books
2007 21:19:23 -0700 From: [EMAIL PROTECTED] To:
flashcoders@chattyfig.figleaf.com Subject: Re: [Flashcoders] xml parse
question What if I don't know what the names are going to be? How can I
check how many attributes are in a node? is there anything like
XMLNode.attributes.length (I know
use pixlib == http://osflash.org/projects/pixlib
and use the Config, ConfigLoader and ConfigLoaderEvent
it convert an xml file to a object
here is 2 good tutorials about it
http://relivethefuture.com/choronzon/2006/11/14/getting-to-know-pixlib/
Or you can save yourself the very slow Array.reverse() and just iterate
through the array backwards, too.
You might be aware of this, but just an FYI, if you're
concerned about attributes being order specific. When you
loop through the attributes with a for statement, you'll get
the
,
Muzak
- Original Message -
From: Steven Sacks | BLITZ [EMAIL PROTECTED]
To: flashcoders@chattyfig.figleaf.com
Sent: Thursday, March 15, 2007 11:04 PM
Subject: RE: [Flashcoders] xml parse question
Or you can save yourself the very slow Array.reverse() and just iterate
through the array
check the docs for
XMLNode.attributes
- Original Message -
From: Carl Welch [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, March 15, 2007 2:11 AM
Subject: [Flashcoders] xml parse question
Hi coders,
I just started working on a new
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
15 matches
Mail list logo