# Loading song, NaN?

**URL:** <https://forum.kirupa.com/t/loading-song-nan/120819>\
**Category:** Uncategorized\
**Created:** [August 27, 2004, 5:03pm UTC](https://forum.kirupa.com/t/loading-song-nan/120819 "2004-08-27T17:03:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fatnslow](https://avatars.discourse-cdn.com/v4/letter/f/7993a0/32.png) [@fatnslow](https://forum.kirupa.com/u/fatnslow)\
**Post date:** [August 27, 2004, 5:03pm UTC](https://forum.kirupa.com/t/loading-song-nan/120819/1 "2004-08-27T17:03:31Z")

</div>

Hey, I have an mp3 on my little site, but when It is supposed to load, instead of the percentage number, its just says NaN, anyone know why?  
Here my code:

```auto

AudioXml = new XML();
AudioXml.ignoreWhite = true;
AudioXml.onLoad = LoadXmlFile;
AudioXml.load(playListPath);
function LoadXmlFile(success) {
 if (success) {
  aPath = new Array();
  asongTitle = new Array();
  aAudio = new Array();
  aAudio = this.firstChild.childNodes;
  AudioTotal = aAudio.length;
  for (i=0; i<AudioTotal; i++) {
   if (aAudio*.nodeName == "AudioProps") {
	aPath.push(aAudio*.attributes.path);
	asongTitle.push(aAudio*.attributes.songTitle);
   }
  }
  AudioPath = aPath[0];
  tAuthor = asongTitle[0];
  AudioActual = 1;
  tCount = AudioActual+" Of "+AudioTotal;
  tText = "Xml Loaded";
 } else {
  tText = "Xml not loaded";
 }
}
Ff.onPress = function() {
 if (AudioActual<AudioTotal) {
  AudioActual += 1;
  AudioPath = aPath[AudioActual-1];
  tAuthor = asongTitle[AudioActual-1];
  MySound.stop();
  Mystatus = "Press Play";
 }
};
Rw.onPress = function() {
 if (AudioActual>1) {
  AudioActual -= 1;
  AudioPath = aPath[AudioActual-1];
  tAuthor = aSongTitle[AudioActual-1];
  MySound.stop();
  Mystatus = "Press Play";
 }
};
PlayBtn.onPress = function() {
 if (FlagPausa == true) {
  MySound.start(SoundPausePos, 0);
  FlagPausa = false;
  SoundPausePos = undefined;
 } else {
  MySound = new Sound();
  volume = 100;
  MySound.setVolume(volume);
  MySound.loadSound(AudioPath, StreamFlag);
  FlagPausa = false;
  _parent.onEnterFrame = function() {
   TB = MySound.getBytesTotal();
   BL = MySound.getBytesLoaded();
   if (BL != TB) {
	TheText2.text = Math.round((BL/TB)*100)+"% Loaded";
   } else {
	TheText2.text = "100% Loaded";
	delete _parent.onEnterFrame;
	MySound.start();
   }
  };
 }
};
StopBtn.onPress = function() {
 MySound.stop();
 Mystatus = "Press Play";
};
PauseBtn.onPress = function() {
 SoundPausePos = MySound.position/1000;
 MySound.stop();
 FlagPausa = true;
};
volUp.onPress = function() {
 if (volume == 100) {
  volume = 100;
 } else {
  volume += 10;
  MySound.setVolume(volume);
 }
};
volDown.onPress = function() {
 if (volume == 0) {
  volume = 0;
 } else {
  volume -= 10;
  MySound.setVolume(volume);
 }
};

```

Thanks,  
fatnslow
