Neil_2004
asked on
onSoundComplete... how do i get it to work
i have made a page containing several pictures, when the pictures are clicked they play a sound. Next to each picture is a button which, when clicked, writes the name of the sound to an array, all of this works fine but when i push the button to play each sound in order, using the code below in particular the "newSound.onSoundComplete = function() {" line, the code never goes through it. i'm probably just missing something but i cannot think of anything. Can anybody help?????
on (click) {
i = 0;
j = _root.sounds[i];
var newSound:Sound = new Sound(this);
newSound.attachSound(j);
newSound.start(13, 1);
do {
newSound.onSoundComplete = function() {
i = i+1;
j = _root.sounds[i];
newSound = new Sound(this);
newSound.attachSound(j);
newSound.start(0, 1);
};
} while (i<50);
}
on (click) {
i = 0;
j = _root.sounds[i];
var newSound:Sound = new Sound(this);
newSound.attachSound(j);
newSound.start(13, 1);
do {
newSound.onSoundComplete = function() {
i = i+1;
j = _root.sounds[i];
newSound = new Sound(this);
newSound.attachSound(j);
newSound.start(0, 1);
};
} while (i<50);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much for your help negatyve
Regards
Neil
p.s. i'll probably be on here frequently asking questions about flash