# PROBLEM! Looping sound with mySound.start using var

**URL:** <https://forum.kirupa.com/t/problem-looping-sound-with-mysound-start-using-var/206271>\
**Category:** flash\
**Created:** [November 6, 2006, 6:44pm UTC](https://forum.kirupa.com/t/problem-looping-sound-with-mysound-start-using-var/206271 "2006-11-06T18:44:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![morganh](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@morganh](https://forum.kirupa.com/u/morganh)\
**Post date:** [November 6, 2006, 6:44pm UTC](https://forum.kirupa.com/t/problem-looping-sound-with-mysound-start-using-var/206271/1 "2006-11-06T18:44:27Z")

</div>

PLEASE HELP ! 🙂  
Hey,  
I can’t figure out why this code isn’t working at all, it seems all correct to me - although I just learned this in school my Instructor has no idea. I want my 5 sounds to loop when they are played. But none of them are! Here is my code:

var mySound:Sound = new Sound();  
//  
var currTrack:Number = 0;  
//  
var mySongs:Array = new Array();  
mySongs = [“music/track0.mp3”, “music/track1.mp3”, “music/track2.mp3”, “music/track3.mp3”, “music/track4.mp3”];  
//…  
var track0:Function = function () {  
currTrack = 0;  
loadSong();  
};  
var track1:Function = function () {  
currTrack = 1;  
loadSong();  
};  
var track2:Function = function () {  
currTrack = 2;  
loadSong();  
};  
var track3:Function = function () {  
currTrack = 3;  
loadSong();  
};  
var track4:Function = function () {  
currTrack = 4;  
loadSong();  
};  
//  
var loadSong:Function = function () {  
mySound.start(0, 9999);  
if (currTrack == 0) {  
mySound.loadSound(mySongs[0], true);  
}  
if (currTrack == 1) {  
mySound.loadSound(mySongs[1], true);  
}  
if (currTrack == 2) {  
mySound.loadSound(mySongs[2], true);  
}  
if (currTrack == 3) {  
mySound.loadSound(mySongs[3], true);  
}  
if (currTrack == 4) {  
mySound.loadSound(mySongs[4], true);  
}  
};  
//  
btn\_ply.onRelease = function() {  
loadSong();  
};  
btn\_stp.onRelease = function() {  
mySound.stop();  
};  
btn\_m0.onRelease = function() {  
track0();  
};  
btn\_m1.onRelease = function() {  
track1();  
};  
btn\_m2.onRelease = function() {  
track2();  
};  
btn\_m3.onRelease = function() {  
track3();  
};  
btn\_m4.onRelease = function() {  
track4();  
};
