/ Published in: ActionScript
URL: http://dandyland.org/?page_id=32
movie clip che seguono il percorso del mouse, ma non sono attaccate ad esso
Expand |
Embed | Plain Text
/*on the first frame of the main scene:*/ i=0; /*copie nella scena*/ /*on the movie clip you want to animate:*/ onClipEvent (load) { _x = 0; _y = 0; v = random(10)+10; } onClipEvent (enterFrame) { finex = _root._xmouse; finey = _root._ymouse; _x += (finex-_x)/v; _y += (finey-_y)/v; } /*or the following, it's your choice.*/ onClipEvent (load) { dx=0; dy=0; v=random(10)+10; _x=(random(8)+1)/10*_root.width; _y=(random(8)+1)/10*_root.height;} onClipEvent(enterframe) { dx=(_root._xmouse-_x)/v; dy=(_root._ymouse-_y)/v; _x+=dx; _y+=dy; } /*then, on an invisible movieclip somewhere in the stage:*/ onClipEvent (load) { for (i=1; i<10; i++) { duplicateMovieClip("_root.freccia", "_root.freccia"+i, i+100); c = eval("_root.freccia"+i); c._x = random(550); c._y = random(400); } }
You need to login to post a comment.
