# Preloader for sound object

**URL:** <https://forum.kirupa.com/t/preloader-for-sound-object/170638>\
**Category:** flash\
**Created:** [November 28, 2005, 11:47am UTC](https://forum.kirupa.com/t/preloader-for-sound-object/170638 "2005-11-28T11:47:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dboers](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dboers](https://forum.kirupa.com/u/dboers)\
**Post date:** [November 28, 2005, 11:47am UTC](https://forum.kirupa.com/t/preloader-for-sound-object/170638/1 "2005-11-28T11:47:36Z")

</div>

I have a movie with three songs using the following code in frame 2:

```auto
song1 = new Sound();
song1.attachSound("song01", "song001", 1);
song2 = new Sound();
song2.attachSound("song02", "song002", 1);
song3 = new Sound();
song3.attachSound("song03", "song003", 1);
sound1_btn.onRelease = function() {
_root.mc_menu.soundRelease.gotoAndStop(2);
song1.start();
};
sound2_btn.onRelease = function() {
_root.mc_menu.soundRelease.gotoAndStop(3);
song2.start();
};
sound3_btn.onRelease = function() {
_root.mc_menu.soundRelease.gotoAndStop(4);
song3.start();
};
stop_btn.onRelease = function() {
_root.mc_menu.soundRelease.gotoAndStop(1);
stopAllSounds();
};

```

In frame 1 i have the following preloader script:

```auto
this.onEnterFrame = function(){
	 tb = this.getBytesTotal();
	 lb = this.getBytesLoaded();
	 if(lb >= tb){
			delete this.onEnterFrame;
			gotoAndStop(2);
	 }
}

```

and a text saying that the sound is loading. But when I play the movie i doesn’t show the text. What am i doing wrong?
