Follow | mouse
Yesterday I sent a mouse to follow, and a little elastic, so today is a mouse to follow the example. Compare Flower effect:
Click here to download the source file
So the code looks like this:
function BOX (): MovieClip {
var mc:movieclip = This.createemptymovieclip ("Boxs", this.getnexthighestdepth ());
var w:number = 10;
var h:number = 10;
Mc.beginfill (0XFFFFFF);
Mc.lineto (w, 0);
Mc.lineto (W, h);
Mc.lineto (0, h);
Mc.lineto (0, 0);
Mc.endfill ();
return MC;
}
var boxs:movieclip = BOX ();
var myarray=new Array (0XFFFFFF,0XFF0000,0XFF9900,0XFFFF00,0X00FF00,0X339999,0X0000FF,0X9900FF,0X000000,0XFFFFFF)
function Gensui (MCS, N) {
for (var i = 0; i<n; i++) {
var mcs:movieclip = Boxs.duplicatemovieclip (Mcs+i, n-i);
var mycolor=new Color (MCs)
Mycolor.setrgb (Myarray[i])
Mcs._alpha=n*n-i*n
MCS.I = i-1;
Mcs.onenterframe = function () {
Eval (mcs+0). _x = _xmouse;
Eval (mcs+0). _y = _ymouse;
Eval (mcs+0). _visible = false;
This._x + = (eval (mcs+this.i). _x-this._x) *0.5+this._width;
This._y + = (eval (mcs+this.i). _y-this._y) *0.5;
};
}
}
Gensui ("Boxs", 10);
Just copy and paste it on the frame. Because it is not difficult to understand, so there is no comment. If there is any place you don't understand, please bring it up. I say give an answer. Here thanks to "water ruthless", "clamp444" two friends to help. Thank you for giving me a lot of help.