# Preload xml file

**URL:** <https://forum.kirupa.com/t/preload-xml-file/226696>\
**Category:** Uncategorized\
**Created:** [May 23, 2007, 7:06am UTC](https://forum.kirupa.com/t/preload-xml-file/226696 "2007-05-23T07:06:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alesspunk](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@alesspunk](https://forum.kirupa.com/u/alesspunk)\
**Post date:** [May 23, 2007, 7:06am UTC](https://forum.kirupa.com/t/preload-xml-file/226696/1 "2007-05-23T07:06:28Z")

</div>

hi i got a multilanguage flash site. All my text is loaded by a xml file. But this is freesing my movie in my server. I want to preload the xml file.

here i create my xml object in a include .as file:

```php

 private function loadXMLFile(): Void {
  var _this:LanguageManager = this;
  _xmlDoc = new XML();
  _xmlDoc.ignoreWhite = true;
  _xmlDoc.onLoad = function(success:Boolean): Void {
   if (success) {
    _this.xml2Array();
   }
  }
  _xmlDoc.load(_xmlPath);
 }
 

```

here is my loader movieclip, in the first frame i put this

```php

 
stop();
onEnterFrame = function () {
 
//here i m trying to preload my xml object

 totalBytes = _parent.getBytesTotal() + _xmlDoc.getBytesTotal();
 loadedBytes = _parent.getBytesLoaded() + _xmlDoc.getBytesLoaded() 
 percent = Math.ceil((loadedBytes/totalBytes)*100);
 gotoAndStop(percent);
 info_txt.text = percent+" %";
 if (percent>=100) {
  _parent.gotoAndPlay("Go");
 }
};

```

somenting is wrong??

tks a lot for any advice!

regards!
