# Txt Vs XML

**URL:** <https://forum.kirupa.com/t/txt-vs-xml/102003>\
**Category:** Uncategorized\
**Created:** [February 18, 2004, 8:12pm UTC](https://forum.kirupa.com/t/txt-vs-xml/102003 "2004-02-18T20:12:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![foochuck](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@foochuck](https://forum.kirupa.com/u/foochuck)\
**Post date:** [February 18, 2004, 8:12pm UTC](https://forum.kirupa.com/t/txt-vs-xml/102003/1 "2004-02-18T20:12:23Z")

</div>

Hello,

I’m wondering what the benefits of loading text data versus xml data into Flash are? Is there a huge speed difference between the two? For example say I’m loading the same amount of data from a text file and an xml file - which would be faster?

Any other benefits or disadvantages between the 2?

Thanks

:mario:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 18, 2004, 8:19pm UTC](https://forum.kirupa.com/t/txt-vs-xml/102003/2 "2004-02-18T20:19:35Z")

</div>

I don’t know about the speed, though I have a feeling that txt files are faster. That’s just a feeling though, don’t take my word for it.

If I’d have the choice, I’d definitely go for XML, mainly because XML is a lot more structured than an ugly serie of &'s, variables and values.

Compare these two:

&var=value&var=value&var=value

\<vars\>  
\<var\>Value\</var\>  
\<var\>Value\</var\>  
\<var\>Value\</var\>  
\</vars\>

You’ll have to admit that XML is a lot more structured and manageable. XML’s primary goal is data storage by the way.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 18, 2004, 8:51pm UTC](https://forum.kirupa.com/t/txt-vs-xml/102003/3 "2004-02-18T20:51:49Z")

</div>

If you’ve got a small amount of data to load (like a single textstring), I suggest you use the txtfile, 'cause it’s a lot of work with getting the XML parsed in flash, and then it’s simply not worth it.  
But if you’ve got a lot of data or data that you wan’t to be able to edit easy, the XML is preferable.

Case one:  
You’re about to load the strings “Hello there little kirupian” and “Voetsjoeba is a belgian guy” into a flashmovie.  
My choice: Text-file.

Case two:  
You’re building a dynamic menusystem with 6 topMenus with 15 subMenus each. You load each menuItem from the external file.  
My choice: XML-file.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 18, 2004, 9:11pm UTC](https://forum.kirupa.com/t/txt-vs-xml/102003/4 "2004-02-18T21:11:59Z")

</div>

I’m probably looking at something like case 2 with alot more variables. Any other good sources for learning how to parse XML with Flash? Once the XML is parsed in Flash can I do things like slice the string and turn it into an array?

Foo :tie:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 18, 2004, 9:34pm UTC](https://forum.kirupa.com/t/txt-vs-xml/102003/5 "2004-02-18T21:34:32Z")

</div>

> \*Originally posted by foochuck \*  
> \*\*Once the XML is parsed in Flash can I do things like slice the string and turn it into an array?  
> \*\*

correct.

you can always search here on the forums, but this will get you started:

XML-driven drop-down menu:

> **[kirupa.com - XML-Driven Drop-Down Menu](https://www.kirupa.com/developer/actionscript/xml_dropdown_menu.htm)**
>
> Create a drop-down menu in Flash that retrieves data from an XML file.

XML with Flash basics:  
[http://www.kirupa.com/developer/actionscript/xmlbasics.htm](http://www.kirupa.com/developer/actionscript/xmlbasics.htm)  
[http://www.kirupa.com/developer/actionscript/xmlinflash.htm](http://www.kirupa.com/developer/actionscript/xmlinflash.htm)  
[http://www.kirupa.com/developer/actionscript/xmltofromflash.htm](http://www.kirupa.com/developer/actionscript/xmltofromflash.htm)
