[AS2] Music player with attachSound in array

NOTE: i’m “somehow” intermediate in coding…And prolly this is a bit complex for my “skills”. Anyway…

This is what i’m basicly trying to:

1.Music player with an array of 3 songs;
2.The music player LOOPS one sound taken from an array of 3, and the sound is attached with attachSound method.
3.There are 3/4 buttons: Previous sound, Stop, Pause, Next Sound. With “previous sound” and “next sound” i actually mean next sound in the array.

So…I’m a bit “stuck” on managing the loaded and attached sounds, aka how to go to next sound, how to go to previous one etc.

This is the code i’ve been able to write down:

var soundFiles:Array = ["9052_ok.mp3", "Glimmer_ok.mp3", "Loop_9095_ok.mp3"];

function playSound()    {
    var my_sound:Sound = new Sound();
    my_sound.attachSound(soundFiles[random(soundFiles.length)]);
    my_sound.start();
    }

I don’t hide the fact that it’s indeeed kinda poor. I’m doing exercises and exercises just to get a better “grip” on how to manage and control sounds.

If some of you is willing to take a deeper look i’ve attached the source. Feel free to take the graphs of the buttons, if it helps :smiley:

NOTE: file is CS4 format!

Any enlightenment is more than welcome, even to show me the “path” to follow.