Help controlling movie with preloader

Hi,

I’m having difficulty controlling a movie with a mc containing a preloader. I would appreciate it if some1 could help me.

i’m using this to create a function and define my sound:

[COLOR=green]function mysound(){
//create a new sound object on this timeline
mysoundobj=new Sound(this)

//attach the sound from the library
mysoundobj.attachSound(“track01”)

//play the sound and loop 999 times
mysoundobj.start(0,999)
} [/COLOR]

I’m then exporting this as sound.swf

Then in my main movie on frame 1 i have a play button, and a stop() in my actions layer. My play button has the actions:

[COLOR=green]on (press) {
gotoAndStop(5);
} [/COLOR]

In frame 5 i have a stop button and a movie clip with this code loading my preloader and playing my sound.swf:

[COLOR=green]onClipEvent(load){
//load the sound movie
loadMovieNum(“sound.swf”,1)
}

onClipEvent(enterFrame){
//create a percentage
percentloaded=Math.floor((_level1.getBytesLoaded()/_level1.getBytesTotal())*10O)

//remove this if you dont want to display a percentage
percentdisplay=percentloaded + “%”

//if the movie is fully loaded
if(percentloaded == 100 && !initialize){

//call the function that creates out new sound and plays it
_level1.mysound()

//dont call call the function again
initialize=true

//hide this movieclip
_visible=false
}
} [/COLOR]

On my stop button i have:

[COLOR=green]on (press) {
stopAllSounds();
gotoAndStop(1O);
} [/COLOR]

And finally i have another instance of the play button on frame 10 with the actions:

[COLOR=green]on (press) {
if(playing!=true) {
_level1.mysoundobj.start(0,999);
playing=true
}
} [/COLOR]

Now this works fine you can c it here

http://www.geocities.com/bobtod2001/main.html

i have nine buttons that i am going to use(only track01 works at the moment), so i want to change it so that when i press my stop button the movie goes to frame 1. Then my play button, when pressed, checks to see if the preloader has loaded and if so jump to frame 10.

I’ve been trying hard to do this but i would appreciate a little help.

I can upload the .fla’s if that will help

Thanks