duplicateMovieClip - Random variables

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.

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;
}

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 :slight_smile:

[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.

:wink:

http://www.imagedoll.com/show.php/10575_particle.swf.html
end result for anyone interested, move the mouse around, slower makes it look better.

nice!