Det må i selvfølgelig også hjertligt gerne. Det her er hvad jeg bruger(og i kan se siden her
http://www.itu.dk/people/msk/dril/lyd/version_test_5.html):
Når der trykes på "afspil" køre denne function som sætter arrayen op afhængig af hvordan ordene er placeret
function setSoundArrays() {
_root.mySoundArray1 = new Array();
_root.mySoundArray2 = new Array();
_root.finalSoundArray = new Array();
_root.count = 0;
for (prop in _root) {
if (typeof (_root[prop].sound) == 'string') {
if (_root[prop]._y>=_root.line2._y-_root.container1._height/2 and _root[prop]._y<_root.line2._y+_root.line2._height) {
xPosValue = Math.round(_root[prop]._x)+100;
_root.mySoundArray1.push({xPos:xPosValue, lyd:_root[prop].sound});
}
if (_root[prop]._y>=_root.line2._y+_root.line2._height and _root[prop]._y<=_root.line1._y+_root.line1._height) {
xPosValue = Math.round(_root[prop]._x)+100;
_root.mySoundArray2.push({xPos:xPosValue, lyd:_root[prop].sound});
}
}
}
_root.mySoundArray1.sortOn("xPos");
_root.mySoundArray2.sortOn("xPos");
_root.finalSoundArray = _root.mySoundArray1.concat(_root.mySoundArray2);
_root.loadSounds();
}
//denne funktion kaldes så
function loadSounds() {
_root['soundObject'+_root.count] = new Sound();
myRef = "
http://www.itu.dk/people/msk/dril/lyd/"+_root.finalSoundArray[_root.count].lyd+".mp3"; _root['soundObject'+_root.count].loadSound(myRef, false);
_root['soundObject'+_root.count].nextNumber = _root.count+1;
_root['soundObject'+_root.count].onLoad = loadNextSound;
_root['soundObject'+_root.count].onSoundComplete = playNextSong;
_root.count++;
}
function loadNextSound() {
if (_root.count<_root.finalSoundArray.length) {
loadSounds();
} else {
_root.count = 0;
_root.fogh_himself.gotoAndPlay(2);
_root.soundObject0.start();
}
}
function playNextSong() {
if (this.nextNumber<_root.finalSoundArray.length) {
_root['soundObject'+this.nextNumber].start();
} else {
_root.fogh_himself.gotoAndStop(1);
}
}
Nu har jeg siddet og arbejdet med det hele dagen, og jeg er ret overbevist om at der ikke er noget galt med scriptet. Problemet er at mp3 lydfilen ligger sig i cahen og anden gang den skal indlæses når den ikke at afvikle onLoad eventen.
Jeg er meget interessrert i at høre kommentare
VH
Michael