Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
Todd Dignan #1
How do i Parsing xml
This how my customers xml is coming across and can not change.
<month name="January">
<day>
<date>01</date>
<name>Thursday</name>
<time>12:03 PM</time>
<comment>It is a hot day</comment>
</day>
<day>
<date>05</date>
<name>Monday</name>
<time>09:28 AM</time>
<comment>Another hot day</comment>
</day>
</month>
The above data structure uses a new node for each bit of core information. It
is well laid out and very readable by humans, however a better structure exists
when using Flash. The data structure below makes more use of the attributes
feature, speeding the parsing process up. It takes longer for Flash to read 6
separate nodes, than it does 6 attributes of a node. The data structure below
is suited better for use with Flash.
How do I get it formated like this?
<month name="January">
<day date="01" name="Thursday" time="12:03 PM" comment="It is a hot day" />
<day date="05" name="Monday" time="09:28 AM" comment="Another hot day" />
</month>
Todd Dignan Guest
-
parsing XML
Why won't this work? I just want to create one Node for each <placemark> tag in the xml. the xmlData trace gets: <kml... -
PDF Parsing
Hello, I'm writing a PDF Parser and I want to recognize lines or Logic units(paragraphs or sentences) in the PDF stream objects. I need to take a... -
Parsing URL
How do I go about parsing a url from the browser location. For example if I have the following url: ... -
Parsing PHP
I am using PHP to develop and web app. The app also has a scripting language for the *end user*. I was thinking if I could expose a very simple... -
[PHP] Parsing PHP
There is the tokenizer extension... http://www.php.net/tokenizer This might give you a good start. -- Peter James petej@phparch.com ... -
Noelbaland #2
Re: How do i Parsing xml
Hello there,
Depending on which version of Flash you're using the parsing of XML is a
little different in Actionscript 3 then Actionscript 2. I personally like the
AS3 way as it's easier to traverse the XML tree.
Here is how I would parse your new structure above in both versions
Noelbaland Guest
-
Todd Dignan #3
Re: How do i Parsing xml
Thanks for the response. I have Flash 8 (AS2)
When I user your sample this is what it get.
January
DATE: undefined
NAME: undefined
TIME: undefined
COMMENT: undefined
DATE: undefined
NAME: undefined
TIME: undefined
COMMENT: undefined
Everything looks good up to the loop.
When I trace the loop I get undefined. I could not figure out why.
Thanks for your help ahead of time.
Todd Dignan Guest
-
Noelbaland #4
Re: How do i Parsing xml
Hello again,
Sorry, I thought you wanted to know how to parse XML for this structure
<month name="January">
<day date="01" name="Thursday" time="12:03 PM" comment="It is a hot day" />
<day date="05" name="Monday" time="09:28 AM" comment="Another hot day" />
</month>
This is the one that the code I wrote is using. I think you're loading in the
other one. Doesn't matter - I've included the for loop for both structures
below so that you can try it with both.
Noelbaland Guest



Reply With Quote

