# XML Data length

**URL:** https://forum.kirupa.com/t/xml-data-length/262641
**Category:** flash
**Created:** [June 8, 2008, 1:48pm UTC](https://forum.kirupa.com/t/xml-data-length/262641 "2008-06-08T13:48:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ricmar](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@Ricmar](https://forum.kirupa.com/u/Ricmar)
#### Post date: [June 8, 2008, 1:48pm UTC](https://forum.kirupa.com/t/xml-data-length/262641/1 "2008-06-08T13:48:26Z")

</div>

Wonder if someone can help, I’ve loaded in to my flash file a bit of text from an external XML document which displays in a text box nicely. What I now need is to be able to get the length of the string. Is this possible?

My initial thought was:[COLOR=Blue]

text\_box.text = xml;[/COLOR]  
[COLOR=Blue]trace(xml.length());

[COLOR=Black]However the trace box returns the value “1” which is assume is a boolean. Any ideas?[/COLOR]  
[/COLOR]

---

<div class="post-metadata">

### Author: ![Alex\_Lexcuk](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alex\_Lexcuk](https://forum.kirupa.com/u/Alex_Lexcuk)
#### Post date: [June 8, 2008, 2:31pm UTC](https://forum.kirupa.com/t/xml-data-length/262641/2 "2008-06-08T14:31:26Z")

</div>

[http://dnadillo.dn.ua/fla/XML/img-xml.swf](http://dnadillo.dn.ua/fla/XML/img-xml.swf)  
[http://dnadillo.dn.ua/fla/XML/mur\_xml\_file\_img.xml](http://dnadillo.dn.ua/fla/XML/mur_xml_file_img.xml)

test text\_box.text.length

---

<div class="post-metadata">

### Author: ![Ricmar](https://avatars.discourse-cdn.com/v4/letter/r/ce73a5/32.png) [@Ricmar](https://forum.kirupa.com/u/Ricmar)
#### Post date: [June 8, 2008, 2:40pm UTC](https://forum.kirupa.com/t/xml-data-length/262641/3 "2008-06-08T14:40:45Z")

</div>

yeah that did it, I actually tried that before but with length() which must have been the problem, thanks Alex

---

<div class="post-metadata">

### Author: ![dthought](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dthought/32/3573_2.png) [@dthought](https://forum.kirupa.com/u/dthought)
#### Post date: [June 8, 2008, 3:27pm UTC](https://forum.kirupa.com/t/xml-data-length/262641/4 "2008-06-08T15:27:15Z")

</div>

Wouldn’t trace(text\_box.text.length); work?

You could also use something like xmlTextElement.toString().length if you wanted 🙂

---

<div class="post-metadata">

### Author: ![dthought](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dthought/32/3573_2.png) [@dthought](https://forum.kirupa.com/u/dthought)
#### Post date: [June 9, 2008, 1:34pm UTC](https://forum.kirupa.com/t/xml-data-length/262641/5 "2008-06-09T13:34:38Z")

</div>

Ah yes, thanks for correcting that, amarghosh… still getting a little crossover knowledge from AS2 to AS3… still catches me out from time to time 🙂
