Three mouse with the realization of effects animation
Look at the results
This is because as is prepared, so I cling to the source document, as long as the code copied to the flash as in the first frame on the
Stage.scaleMode = "noScale"
Stage.align = "TL"
For (i = 1; i <= 4; i) (
_root.createEmptyMovieClip ( "Point" i, 0-i); / / new MC
/ / Mc of the x-axis, y-axis
_root [ "Point" i]. _x = Stage.width / 2;
_root [ "Point" i]. _y = Stage.height / 2;
/ / Mouse across the effectiveness of
_root [ "Point" i]. OnMouseMove = function () (
This._x = _root._xmouse (Math.random () * 70) -35;
This._y = _root._ymouse (Math.random () * 70) -35;
);
)
/ / Set a color group
HexColors = new Array ( "0xCC00FF", "0xCC33FF", "0xCC66FF", "0xCC99FF", "0xCCCCFF", "0xCCFFFF");
/ / Mouse lit up when new mc, and filled with random color and alpha values were established
This.onMouseMove = function () (
I;
This.createEmptyMovieClip ( "shape" i, i * 10);
With (this [ "shape" i]) (
BeginFill (hexColors [Math.floor (Math.random () * hexColors.length)], (Math.random () * 40) 60);
/ / Draw a line implementation procedures
MoveTo (_root.point1._x, _root.point1._y);
CurveTo (_root.point2._x, _root.point2._y, _root.point3._x, _root.point3._y);
CurveTo (_root.point4._x, _root.point4._y, _root.point1._x, _root.point1._y);
EndFill ();
)
/ / Copy the current mc based X, Y-axis, alpha values, and filled with color, as a shadow.
This [ "shape" i]. DuplicateMovieClip ( "shadow" i, (10 * i) -1);
This [ "shadow" i]. _x This = [ "shape" i]. _x 6;
This [ "shadow" i]. _y This = [ "shape" i]. _y 6;
This [ "shadow" i]. _alpha = 60;
This.grey = new Color (this [ "shadow" i]);
This.grey.setRGB ( "0×999999");
);
Only a simple explanation, as the basis for a friend learning
Stage.scaleMode = "noScale";Stage.align = "TL";
For (i = 1; i <= 4; i) (
_root.createEmptyMovieClip ( "Point" i, 0-i);
/ / New MC
/ / Mc of the x-axis, y-axis
_root [ "Point" i]. _x = Stage.width / 2;
_root [ "Point" i]. _y = Stage.height / 2;
/ / Mouse across the effectiveness of
_root [ "Point" i]. OnMouseMove = function () (
This._x = _root._xmouse (Math.random () * 70) -35;
This._y = _root._ymouse (Math.random () * 70) -35;
);
)
/ / Set a color group
HexColors = new Array ( "0xCC00FF", "0xCC33FF", "0xCC66FF", "0xCC99FF", "0xCCCCFF", "0xCCFFFF");
/ / Mouse lit up when new mc, and filled with random color and alpha values were established
This.onMouseMove = function () (
I;
This.createEmptyMovieClip ( "shape" i, i * 10);
With (this [ "shape" i]) (
BeginFill (hexColors [Math.floor (Math.random () * hexColors.length)], (Math.random () * 40) 60);
/ / Draw a line implementation procedures
MoveTo (_root.point1._x, _root.point1._y);
CurveTo (_root.point2._x, _root.point2._y, _root.point3._x, _root.point3._y);
CurveTo (_root.point4._x, _root.point4._y, _root.point1._x, _root.point1._y);
EndFill ();
)
/ / Copy the current mc based X, Y-axis, alpha values, and filled with color, as a shadow.
This [ "shape" i]. DuplicateMovieClip ( "shadow" i, (10 * i) -1);
This [ "shadow" i]. _x This = [ "shape" i]. _x-6;
This [ "shadow" i]. _y This = [ "shape" i]. _y 6;
This [ "shadow" i]. _alpha = 60;
This.grey = new Color (this [ "shadow" i]);
This.grey.setRGB ( "0×999999");
);
/ / Delete some of the increase
Var ii: Number = 6;
Function del () (
If (_root [ "shape" ii]) (
_root [ "Shape" ii]. RemoveMovieClip ();
_root [ "Shadow" ii]. RemoveMovieClip ();
Ii;
)
)
SetInterval (del, 10);
Results are as follows:
In fact, the original better, the more to a greater Buhaokan
Import mx.transitions.Tween;Import mx.transitions.easing .*;
Var i: Number = 0;
Var mcname: Number = 0;
Var x: Number = _xmouse, y: Number = _ymouse;
Var rgb: Array = new Array ( "0" and "1", "2", "3" and "4" and "5", "6", "7" and "8", "9", "A "," B "and" C "," D "," E "and" F ");
Var mousemove: Object = new Object ();
Mousemove.onMouseMove = function () (
Fline ();
);
Function fline () (
Var a: Number = Math.floor (Math.random () * 16);
Var b: Number = Math.floor (Math.random () * 16);
Var c: Number = Math.floor (Math.random () * 16);
Var d: Number = Math.floor (Math.random () * 16);
Var e: Number = Math.floor (Math.random () * 16);
Var f: Number = Math.floor (Math.random () * 16);
Var g: Number = Math.floor (Math.random () * 6);
This.createEmptyMovieClip ( "line" i, i);
Mycolor = new Color (this [ "line" i]);
Mycolor.setRGB ( "0x" rgb rgb [a] [b] rgb rgb [c] [d] rgb rgb [e] [f]);
With (this [ "line" i]) (
LineStyle (g, 0×0000, 100);
MoveTo (x, y);
LineTo (_xmouse, _ymouse);
)
X = _xmouse;
Y = _ymouse;
Mcname_mc this = [ "line" i];
I;
)
SetInterval (enterframes, 10);
Function enterframes () (
If (_root [ "line" mcname]) (
Fdown (_root [ "line" mcname]);
Mcname;
)
)
Function fdown (mc_mc: MovieClip) (
Var i: Number = mc_mc._y;
Down = new Tween (mc_mc, "_y" Elastic.easeIn, i, i 200, 1, true);
Down.onMotionStopped = function () (
Mc_mc.removeMovieClip ();
);
)
Mouse.addListener (mousemove);
The original:
Import mx.transitions.Tween;
Import mx.transitions.easing .*;
Var i: Number = 0;
Var mcname: Number = 0;
Var x: Number = _xmouse, y: Number = _ymouse;
Var mousemove: Object = new Object ();
Mousemove.onMouseMove = function () (
Fline ();
);
Function fline () (
Var a: Number = Math.random () * 5;
Var b: Number = Math.random () * 100;
This.createEmptyMovieClip ( "line" i, i);
With (this [ "line" i]) (
LineStyle (1, 0×0000, 100);
MoveTo (x, y);
LineTo (_xmouse, _ymouse);
)
X = _xmouse;
Y = _ymouse;
Mcname_mc this = [ "line" i];
I;
)
SetInterval (enterframes, 10);
Function enterframes () (
If (_root [ "line" mcname]) (
Fdown (_root [ "line" mcname]);
Mcname;
)
)
Function fdown (mc_mc: MovieClip) (
Var i: Number = mc_mc._y;
Down = new Tween (mc_mc, "_y" Elastic.easeIn, i, i 200, 1, true);
Down.onMotionStopped = function () (
Mc_mc.removeMovieClip ();
);
)
Mouse.addListener (mousemove);
Results are as follows:
Tags: css effects firefox, css mouse style, div effects






Leave a Reply