XML with a preloader

hi.

i’ve been browsing the net for the XML and preloader issue. there are several threads about the preloader not working with xml, but the answers get side-tracked to something else.

I’ve designed a jukebox using Flash and XML, where the mp3s are loaded externally. the jukebox works fine, but not the preloader. the preloader works locally but not online. apparently there’s a bug using preloaders with XML, where the getBytesLoaded() is not recognised.

if you have a look at http://www.thiscolour.co.uk/media.html and click “Music”. A new pop up window will appear for the SWF file. the mp3s will load correctly but the preloader doesn’t show the progress of downloading the file. the jukebox worked fine last night and the preloader as well, but today it didn’t work.

i’m seriously stuck and i’ve ran out of solutions to solve this problem. does anybody have any idea how to solve this problem?

i just want the preloader to show the progress results when downloading the mp3. i’m using flash 8, but i’ve exported the SWF file in both Flash 6.0 and 7.0. Neither of those version the preloader works. Thanks.

Regards,
Incevolebus.

here’s the complete code:

//loading and instatiating XML content
numberTracks = 8;
tracklist_xml = new XML();
tracklist_xml.onLoad = this.XMLLoaded;
tracklist_xml.ignoreWhite = true;
tracklist_xml.load(“tracklist.xml”);

//XMLLoaded function
function XMLLoaded()
{
for(i=1; i<numberTracks; i++)
{
item = tracklist_xml.firstChild.childNodes[i-1].firstChild;
_root[“track”+i].song.text = item.firstChild.toString();
item = item.nextSibling;
_root[“track”+i].file = item.firstChild.toString();
item = item.nextSibling;
}
}

//play back actions
mySound = new Sound(this);

function newSong(songNumber)
{
if(this[“track”+songNumber].selected)
{
mySound.loadSound(this[“track”+songNumber].file, false);
this.songTitle.text = this[“track”+trackNum].song.text;
}
else
{
nextTrack();
}
}

function playSong()
{
mySound.start();
paused = false;
}

mySound.onLoad = playSong;
mySound.onSoundComplete = nextTrack;
trackNum = 1;

previous_btn.onPress = function()
{
if(trackNum>1)
{
trackNum -= 1;
}
while( (_root[“track”+trackNum].selected !=true) and (trackNum>1) )
{
trackNum -= 1;
}
newSong(trackNum);
};

play_btn.onPress = function()
{
newSong(trackNum);
};

pause_btn.onPress = function()
{
if(paused)
{
paused = false;
mySound.start(mySound.position/1000);
}
else
{
paused = true;
mySound.stop();
}
};

stop_btn.onPress = function()
{
trackNum = 1;
mySound.stop();
};

next_btn.onPress = nextTrack;

function nextTrack()
{
if(trackNum>=numberTracks)
{
anySelected = false;
for(j=1; j<=numberTracks; j++)
{
if(this[“track”+j].selected)
{
anySelected = true;
}
}
if(loop and anySelected)
{
trackNum = 1;
newSong(1);
}
else
{
trackNum = 1;
mySound.stop();
}
}
else
{
trackNum += 1;
newSong(trackNum);
}
}

//play back display
this.onEnterFrame = function()
{
//preloader
*bar.gotoAndStop(Math.floor((mySound.getBytesLoaded()/mySound.getBytesTotal())100));

timePlayingSeconds = Math.floor( (mySound.position/1000)%60);
if(timePlayingSeconds &lt; 10)
{
    timePlayingSeconds = "0"+timePlayingSeconds;
}
timePlaying.text = Math.floor( (mySound.position/1000)/60) + ":"+timePlayingSeconds;
timeTotalSeconds = Math.floor( (mySound.duration/1000)%60);
if(timeTotalSeconds&lt;10)
{
    timeTotalSeconds = "0"+timeTotalSeconds;
}
timeTotal.text = Math.floor( (mySound.duration/1000)/60)+ ":" + timeTotalSeconds;

};