Random mouse trails

I’m looking for a tutorial, or for the scripting to create a mouse trail that has random movement, but that follows the mouse - also i have seen one, ca’t remeber where, that casts ‘shadows’ - any ideas?\r\rthanks to kirupa for cool understandable site. I’m only recently becoming aware of the ease and power of flash.

I don’t really see how a trail can follow the mouse in a random way, but hey, everything’s possible with flash… \rpom 0]

jeremydecker.s5.com/random_trailer.swf\r[url=“http://jeremydecker.s5.com/random_trailer.fla”]jeremydecker.s5.com/random_trailer.fla\r\ri think that’s what you’re talking about.\r:) \rjeremy

Wow.

lol pom…stop drooling. :lol:

I mean : look at that ! Stop your mouse, it’s even funnier than when you move it !\r\rpom 0] \r\rHey ! I made it to 1 kPosts !! 500 to go !

lol yeah i saw that…its wild, but you’re funny about it.

can you try to explain that code a little bit?\r\rnXmov+=(_xmouse0.15);\rnYmov+=(_ymouse0.15);\rnXmov*=0.95;\rnYmov*=0.95;\rif(Math.random()<0.2){\r nXmov+=(Math.random()*9)-5;\r}\rif(Math.random()<0.2){\r nYmov+=(Math.random()*9)-5;\r}\r_x+=nXmov;\r_y+=nYmov;\r\r\ri think i understand, but i just can’t explain it to myself

i think i understand, but i just can’t explain it to myself
Yeah, right !\rpom 0]

// moves object towards the mouse.\rnXmov+=(_xmouse0.15);\rnYmov+=(_ymouse0.15);\r// provides friction so it won’t go too fast.\rnXmov*=0.95;\rnYmov*=0.95;\r// increases or decreases speed on _x axis.\rif(Math.random()<0.2){\r// returns a floating point number from -2 to 2.\rnXmov+=(Math.random()*9)-5;\r}\r// increases or decreases speed on _y axis.\rif(Math.random()<0.2){\r// returns a floating point number from -2 to 2.\rnYmov+=(Math.random()*9)-5;\r}\r// changes the position of the object.\r_x+=nXmov;\r_y+=nYmov;\r\r:) \rjeremy

how bout these:\r<a href=http://www.danalu.com/thoriphes/rm.swf>http://www.danalu.com/thoriphes/rm.swf</a>\r<a href=http://www.danalu.com/thoriphes/rm2.swf>http://www.danalu.com/thoriphes/rm2.swf</a>\r\rpretty random, the first follows your mouse at a given distance, and then follows its own random path when you move away. this was an accident, but for some reason, the lil ball gets attracted to the mouse, even when it’s out of the range i set it at. weird, but cool.

oh my… i like the first one a lot.\rnice graphics!\r:) \rjeremy

thanks. oh, and POM! SHHHHH!!

Come on !! Don’t try to bull**** me !\rpom 0] \rAnd Thoriphes, that first swf sure is random. But I like th trailers you put in the Animation section better :smiley:

wut i meant was i understood the different parts of the code, but i wasn’t sure what each part did. like the friction part i had no idea what the “*=” did. or that the (Math.random()*9)-5 was for speed. I didn’t mean that I new exactly what each part meant. I don’t bullsh!t! lol

i might post those two on kirupa.com as source files. and jubba, “x *= 3” is the same thing as x = x * 3; and Math.random() gets a random number from 0.0 to 1.0 (decimal) and then that num is multiplied by 9, then 5 is subtracted from it. essentially, a random number between -5 and 4. try and follow me here: the least number Math.random() can give is 0.0, which is rare. but anyway, times 9 is 0, minus 5 is -5. that’s the least possible number from this line. now the greatest possible number from Math.random() is 1, times 9 is 9, and minus 5 is 4. what i just should you is a range of random numbers.

actually that’s a random number from -4 to 4.\r:P\rjeremy

thanks thoriphes and jeremy

deam!.. tat example of the blu light… is like hipnosis…for me… to much!..maybe one day!..whit a teacher!..\r\rvery nice!\r\rJOSS