Hi all
I have two Sound loops in my flash movie and I would like to have "loop_1" play once and then immediately after "loop_2" starts and then loops forever. can this be done without a gap between the loops.
Cheers
Chris
Printable View
Hi all
I have two Sound loops in my flash movie and I would like to have "loop_1" play once and then immediately after "loop_2" starts and then loops forever. can this be done without a gap between the loops.
Cheers
Chris
i imaginthe problem is the loading between the end of 1 and the start of 2.
at the beggining of the first loop, load the 2nd and then stop it straight away. use get sound duration and get sound played to determine when 1 has finished then play 2 again use duration and played to know when to restart the sound.
Hi mate
I actualy found the code below and it does what I want but for some reason there is a slight gap/delay between the first stoping and the second starting.
here is the code.....what do you think? is there a better way to do this or do you know of a way the get rid of the gap.
CheersPHP Code:
stop();
introSound = new Sound();
introSound.attachSound("intro");
trackSound = new Sound();
trackSound.attachSound("track");
cymbolSound = new Sound();
cymbolSound.attachSound("cymbol");
introSound.start();
introSound.onSoundComplete = function() {
trackSound.start(0,16);
cymbolSound.start();
}
trackSound.onSoundComplete = function() {
introSound.start();
cymbolSound.start();
}
Chris
that code above looks pretty good to me, thats probably the way I'd got about doing it, 2 sound objects then use a onSoundComplete function to start looping "loop_2".
only thing that I question in that code is they haven't declared where each sound object is to be located.
i mean they got:
introSound = new Sound();
and I think it should be:
introSound = new Sound(this); //to load the object on the timeline where this code is placed
or:
introSound = new Sound(_root.myMC); // a movieclip to contain that sound.