# Preloader for dynamic xml text. how?

**URL:** <https://forum.kirupa.com/t/preloader-for-dynamic-xml-text-how/184456>\
**Category:** Uncategorized\
**Created:** [April 5, 2006, 8:11am UTC](https://forum.kirupa.com/t/preloader-for-dynamic-xml-text-how/184456 "2006-04-05T08:11:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fruityDJ](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@fruityDJ](https://forum.kirupa.com/u/fruityDJ)\
**Post date:** [April 5, 2006, 8:11am UTC](https://forum.kirupa.com/t/preloader-for-dynamic-xml-text-how/184456/1 "2006-04-05T08:11:13Z")

</div>

Hi,

Im creating a news section for my project where i have a swf in which ill load xml text (news…ie site updates) is it possible to have a preloader there ? or it loads reeally fast and no need for it ?

note. im gonna embed pixel font.

any idea…link that helps …appriciated  
thx

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 5, 2006, 8:15am UTC](https://forum.kirupa.com/t/preloader-for-dynamic-xml-text-how/184456/2 "2006-04-05T08:15:53Z")

</div>

Do you want a preloader for the XML or the entire SWF?

---

<div class="post-metadata">

**Author:** ![fruityDJ](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@fruityDJ](https://forum.kirupa.com/u/fruityDJ)\
**Post date:** [April 5, 2006, 8:20am UTC](https://forum.kirupa.com/t/preloader-for-dynamic-xml-text-how/184456/3 "2006-04-05T08:20:45Z")

</div>

just for the xml …

also if its easy…which is the best method to load simple xml file (text…and propably a tiny thumbnail pic) ?

thx canadian

---

<div class="post-metadata">

**Author:** ![J11](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@J11](https://forum.kirupa.com/u/J11)\
**Post date:** [April 5, 2006, 8:32am UTC](https://forum.kirupa.com/t/preloader-for-dynamic-xml-text-how/184456/4 "2006-04-05T08:32:08Z")

</div>

do we need a seperate preloader for loading xml too. cannt we have it all in one with the movie itself :ponder:

---

<div class="post-metadata">

**Author:** ![fruityDJ](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@fruityDJ](https://forum.kirupa.com/u/fruityDJ)\
**Post date:** [April 5, 2006, 8:33am UTC](https://forum.kirupa.com/t/preloader-for-dynamic-xml-text-how/184456/5 "2006-04-05T08:33:35Z")

</div>

yea…but since xml load dynamic…i guess we do need …especially when u have a long block of text (xml)

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 5, 2006, 8:37am UTC](https://forum.kirupa.com/t/preloader-for-dynamic-xml-text-how/184456/6 "2006-04-05T08:37:40Z")

</div>

Here’s how I’d do it:

```auto
mx.transitions.OnEnterFrameBeacon.init();
var x:XML = new XML();
x.ignoreWhite = true;
x.load("some.xml");
MovieClip.addListener(x);
x.onEnterFrame = function():Void {
 //ratio between bytes loaded and total bytes of the XML file
 var perunus:Number = this.getBytesLoaded() / this.getBytesTotal();
};
x.onLoad = function(success:Boolean):Void {
 if (success) {
  delete this.onEnterFrame;
  //code for if XML loads properly
 } else {
  //code for if XML does not load
 }
};

```
