PDA

View Full Version : Random Glitter



losse
March 13th, 2006, 11:00 AM
hi there
I'm trying to create an effect on an image where every once in a while a glitter shines from one of the corners of the images.

is there a way to ask a movie clip to play randomly? I'd rather hope to do this than stretch the timeline out over 500 frames and loop the sequence.

Thanks

KyoKusanagi
March 13th, 2006, 11:14 AM
movieClip.onEnterFrame = function(){
if(Math.floor(Math.random()*50)==1)
this.play();
}

i just don't know your movie's setup so hope this code implies.

losse
March 13th, 2006, 01:36 PM
all I did is create a movie clip. With a tween that makes up the glitter. Nothing fancy.

Then I brought that movie clip on the main stage.

So I would put that script inside the movie clip or in the frame on the main stage where the movie clip resides?

Tahnks for your help!

KyoKusanagi
March 14th, 2006, 10:21 AM
Oh i see... which means also that it's a single movieClip?
okay, i guess my code would do. Did you give it a try?