Random Script
- Started
- Last post
- 13 Responses
- silencer
A wee flash help if possible.
I have a piece of .as which randomizes sounds being played which are linked from the library. I need to script it so the sounds don't repeat straight away.
Anyways heres the script. I hope someone can help.
soundlist1 = new Array("randomOne","randomTwo", "randomThree");
mysound = new Sound(this);function playSound(sndlist){
randomSoundNum = Math.round(Math.random() * (sndlist.length - 1));
_root.mysound.stop();
_root.mysound.attachSound(sndlis...
_root.mysound.start();
}playSound(soundlist1);
- silencer0
*Bump
- enobrev0
well, you could shuffle the array and then play through it in 'order'.
here's an as shuffle function http://www.sephiroth.it/proto_de…
- silencer0
That is wicked, this opens up the possibilities tremendously! Cheers Enobrev.
- JazX0
Hmmm, I have to do the same thing today with this eLearning module. Anybody have anything like this done?
- JazX0
come on bump, bump.
- JazX0
so for:
Array.prototype.shuffle=function...
for(i=0;i
- versa0
not quite sure what you all need...
Foomp3.onSoundComplete = function (){
Foomp3.stop;
}or
load the mp3 into an MC and then use 'unloadMovie' when the sound is completed
- JazX0
Array.prototype.shuffle=function...
for(i=0;i
- JazX0
ok now I have this set up on a button:
(release) {
gotoAndPlay("frame90");
}
on (release) {
what_number = Number(random(11))+2;
tellTarget ("random_number") {
gotoAndStop(what_number);
}
}
- ganon0
PVN doesnt like "greater than" & "less than" signs....
- Nematoth0
it won't let you put any ascii vode in fact.. : (
- mrock0
you had me at "I have a piece of .as(.ass) which randomizes " sorry bad joke :0]>
- JazX0
lol, no props I got it to work with an MC