Hello,
I am working on a piece now that will have 10 invisible MC’s (1-10) stacked on frame 1 in seperate layers that function like buttons on the main timeline. Each of these mc’s will trigger a corresponding mc (A-J) to become visible and play and also start a sound file. This I have all worked out.
What I am writing about is a random function. When 1 triggers A, I would like one of five distinct MC’s inside of A to be randomly selected to play, both with sound and with image.
Right now I’m working on the random function with sound, and I’m in need of soome assistance. I’m not sure of my approach, but why I’m stuck in particular now is because ususally when attaching a sound to an MC, when the sound is called it is through the name of the sound rather than the mc name and as I’ve created a random function I can’t very well call the sound name as then it won’t be random. Here’s what I’ve got:
sound1 = new Sound(soundHolder1_mc);
sound1.attachSound(“chime”);
sound2 = new Sound(soundHolder2_mc);
sound2.attachSound(“psychic”);
sound3 = new Sound(soundHolder3_mc);
sound3.attachSound(“doctor”);
snd1 = this._parent.soundHolder1_mc.sound1;
snd2 = this._parent.soundHolder2_mc.sound2;
snd3 = this._parent.soundHolder3_mc.sound3;
var i = Number = Math.ceil(Math.random()*3);
soundMaker1_mc = eval(“snd”+i);
invisible1_mc.onRollOver = function() {
sound1.start(0,100);
}
Any and all help would be appreciated.
-Llyfre