Groups | Blog | Home
all groups > flash actionscript > march 2006 >

flash actionscript : XML RAM usage



hexatropic
3/15/2006 9:01:27 PM
Can anyone tell me what is the best way to handle XML data once it's loaded
into Flash? I am reading "XML for Flash" from Friends of ED, and the author is
loading an XML doc, and then using the data tree in the XML object to hold all
of the information for later use. This is appealing, because the tree structure
in the XML already models the data very well, and is intuitive to work with.

I am concerned though, (based on things I've heard) that this might be RAM
intensive and make for kludgy performance. If i were to transfer everything
from the tree into a set of variables and/or arrays, and then "null" the XML
object, would this perform better? It sure would be a lot of extra work to
re-model all of the data
Patrick Bay
3/15/2006 9:29:43 PM
Hi,

I'm a big proponent of keeping XML in its native state. It's
already a group of cross-linked associated arrays (childNodes, for
example) and it's very easy to traverse. Since XML is a native language
format in Flash, it's as fast as you can get. It's not any more RAM
intensive than parsing everything into separate arrays since you're re-
creating the same structure outside of the XML object. However, you can
quickly test this for yourself by seeing the memory usage of the Flash
player in your Task Manager and comparing this to a parsed XML tree with
the XML data removed. I believe you'll find the parsed data to be larger
because you've decoupled all of the relationships of the linked arrays.
Whereas previously arays (in XML) would simply contain pointers to
offsets, now they contain copies of the data. Hope this helps.

Regards,
Patrick

__________/ BAY NEW MEDIA \____________________

Flash Application Development
& Technology Integration

http://www.baynewmedia.com/
email: contact at baynewmedia dot com
\______________________________________________

"hexatropic" <webforumsuser@macromedia.com> wrote in
news:dv9vb7$ccd$1@forums.macromedia.com:

[quoted text, click to view]

AddThis Social Bookmark Button