# Music tracks out of sync in kid's DJ game

**URL:** <https://forum.kirupa.com/t/music-tracks-out-of-sync-in-kids-dj-game/239052>\
**Category:** flash\
**Created:** [September 18, 2007, 11:04am UTC](https://forum.kirupa.com/t/music-tracks-out-of-sync-in-kids-dj-game/239052 "2007-09-18T11:04:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pollie](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@pollie](https://forum.kirupa.com/u/pollie)\
**Post date:** [September 18, 2007, 11:04am UTC](https://forum.kirupa.com/t/music-tracks-out-of-sync-in-kids-dj-game/239052/1 "2007-09-18T11:04:20Z")

</div>

I’m making this mixing game for kids: [http://zrreintjes.fatcow.com/flash/game.html](http://zrreintjes.fatcow.com/flash/game.html)  
It’s based on one continuous piano track which loops 7 times. Meanwhile you add instruments by dragging the icons onto the boat. It’s supposed to sound cool only it doesn’t because I can’t get the thing to play in sync, even though the tracks are millisecond-tailored to fit the frames exactly. The timeline is subdivided into eight parts per 1 piano-loop, think of them as 8 bars, meant so shorter sounds can be added on the fly, instead of them only joining in at the end of each piano-loop (16 sec each). But already at the end of each of the 7 piano-loops, the sound stops for a split second. I’m thinking it may be due to the length of the script checking which intruments are loaded\*. So I’ve not yet tried to add the other sounds on the fly as this would only make the ‘hitches’ more frequent. At the end of the game there’s a demo so you can hear what i could sound like if it worked properly. Sounds cool, huh? But the game doesn’t and I’ve run out of ideas how to fix it. It should be simple, but I suspect the whole thing will have to be built from scratch in a totally different way. The question is how. Anybody got any bright ideas?

```
  *if (_root.bootje.lading.schelpen_mc_boot2) {
    reply_txt.text="Schelpen!";
    coolTune1 = new Sound (soundLoader1);
    coolTune1.start(0,8);
    coolTune1.loadSound("mp3/schelpen.mp3", true);
    trace("Geluid Schelpen");
}
else{trace("Geluid Schelpen Uit");}

```

if (\_root.bootje.lading.bekken\_mc\_boot2) {  
reply\_txt.text=“Bekken!”;  
coolTune2 = new Sound (soundLoader2);  
coolTune2.start(0,8);  
coolTune2.loadSound(“mp3/bekken.mp3”, true);  
trace(“Geluid Bekken”);  
}  
else{trace(“Geluid Bekken Uit”);}

if (\_root.bootje.lading.drums\_mc\_boot2) {  
reply\_txt.text=“Drums!”;  
coolTune4 = new Sound (soundLoader);  
coolTune4.start(0,4);  
coolTune4.loadSound(“mp3/drums.mp3”, true);  
trace(“Geluid drums”);  
}  
else{trace(“Geluid drums Uit”);}

if (\_root.bootje.lading.tweebongos\_mc\_boot2) {  
reply\_txt.text=“Tweebongos!”;  
coolTune6 = new Sound (soundLoader6);  
coolTune6.start(0,4);  
coolTune6.loadSound(“mp3/bongo.mp3”, true);  
trace(“Geluid Tweebongos”);  
}  
else{trace(“Geluid Tweebongos Uit”);}

if (\_root.bootje.lading.draaitafel\_mc\_boot2) {  
reply\_txt.text=“Draaitafel!”;  
coolTune8 = new Sound (soundLoader8);  
coolTune8.start(0,4);  
coolTune8.loadSound(“mp3/draaitafel.mp3”, true);  
trace(“Geluid Draaitafel”);  
}  
else{trace(“Geluid Draaitafel Uit”);}
