Combined Code
frame 1 {
var sy = new Sound(mymc);
var syn = 's1';
stop();
}
button 12 {
on (release, keyPress '<Left>') {
if (this._currentframe > 101) {
gotoAndPlay(this._currentframe - 100);
} else {
gotoAndPlay(this._currentframe + 700);
}
}
}
button 16 {
on (release, keyPress '<Right>') {
if (this._currentframe < 701) {
gotoAndPlay(this._currentframe + 100);
} else {
gotoAndPlay(this._currentframe - 700);
}
}
}
movieClip 17 {
}
frame 2 {
if (sy.position >= sy.duration) {
sy.stop(syn);
syn = 's' + String(Math.floor(Math.random() * 8 + 1));
sy.attachSound(syn);
sy.start();
}
}
frame 101 {
gotoAndPlay(2);
}
frame 102 {
if (sy.position >= sy.duration) {
sy.stop(syn);
syn = 's' + String(Math.floor(Math.random() * 8 + 1));
sy.attachSound(syn);
sy.start();
}
}
frame 201 {
gotoAndPlay(102);
}
frame 202 {
if (sy.position >= sy.duration) {
sy.stop(syn);
syn = 's' + String(Math.floor(Math.random() * 8 + 1));
sy.attachSound(syn);
sy.start();
}
}
frame 301 {
gotoAndPlay(202);
}
frame 302 {
if (sy.position >= sy.duration) {
sy.stop(syn);
syn = 's' + String(Math.floor(Math.random() * 8 + 1));
sy.attachSound(syn);
sy.start();
}
}
frame 401 {
gotoAndPlay(302);
}
frame 402 {
if (sy.position >= sy.duration) {
sy.stop(syn);
syn = 's' + String(Math.floor(Math.random() * 8 + 1));
sy.attachSound(syn);
sy.start();
}
}
frame 501 {
gotoAndPlay(402);
}
frame 502 {
if (sy.position >= sy.duration) {
sy.stop(syn);
syn = 's' + String(Math.floor(Math.random() * 8 + 1));
sy.attachSound(syn);
sy.start();
}
}
frame 601 {
gotoAndPlay(502);
}
frame 602 {
if (sy.position >= sy.duration) {
sy.stop(syn);
syn = 's' + String(Math.floor(Math.random() * 8 + 1));
sy.attachSound(syn);
sy.start();
}
}
frame 701 {
gotoAndPlay(602);
}
frame 702 {
if (sy.position >= sy.duration) {
sy.stop(syn);
syn = 's' + String(Math.floor(Math.random() * 8 + 1));
sy.attachSound(syn);
sy.start();
}
}
frame 801 {
gotoAndPlay(702);
}