Flash to make a pure code colorful mouse follow

Source: Internet
Author: User
Tags eval window
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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.