It seems like the random variables in my duplicated movieclips are all the same, any way to change this?
To explain a bit more in detail: I got a movieclip with a few random variables and actions and I duplicate this movieclip and want the duplicate to have different random variables than the first one, but it gets identical ones.
pantas
July 3, 2008, 10:24am
2
think about it…why is that happening?
because you duplicate it when the variables are set…
change the script so that when you duplicate the movie, you create those random vars…
or paste the code here and well help you
Yeah, I figured. But how do I create variables outside of onClipEvent(load) properly?
onClipEvent (load) {
//variables
rndm = Math.random()*2;
rndm2 = Math.random()+1*15;
rndm3 = Math.random()*100;
}
pantas
July 3, 2008, 10:44am
4
onClipEvent (load) {
//variables
[COLOR="Red"]this[/COLOR].rndm = Math.random()*2;
[COLOR="Red"]this[/COLOR].rndm2 = Math.random()+1*15;
[COLOR="Red"]this[/COLOR].rndm3 = Math.random()*100;
}
now the vars are inside the clip
[quote=pantas;2352982]onClipEvent (load) {
//variables
[COLOR=Red]this[/COLOR].rndm = Math.random()*2;
[COLOR=Red]this[/COLOR].rndm2 = Math.random()+1*15;
[COLOR=Red]this[/COLOR].rndm3 = Math.random()*100;
}
now the vars are inside the clip :)[/quote]
/facepalm
Such an easy solution. Worked great, thanks.
http://www.imagedoll.com/show.php/10575_particle.swf.html
end result for anyone interested, move the mouse around, slower makes it look better.