onClipEvent(load)
{ }
Executes
only when the movie clip first loads
which only will happen once.
mosx
= 0;
Creates
variable to set inertia difference
by working with the current _xmouse
position and the new _xmouse position.
mosy
= 0;
Creates
variable to set inertia difference
by working with the current _ymouse
position and the new _ymouse position.
onClipEvent(enterFrame)
{ }
Starts
a movie clip loop which execute
the code within the { } brackets
every frame.
difx = mosx - _root._xmouse;
Takes 'mosx' and subtracts by the
_xmouse mouse position to yield
the difference.
dify = mosy - _root._ymouse;
Takes 'mosy' and subtracts by the
_ymouse mouse position to yield
the difference.
mosx -= difx / 8;
Subtracts the total of the _xmouse
position and 'mosx' and 8 determines
the speed of the effect. The
higher the number the slower the
inertia.
mosy -= dify / 8;
Subtracts the total of the _ymouse
position and 'mosy' and 8 determines
the speed of the effect. The
higher the number the slower the
inertia.
_root.graphic1._alpha
= (mosx / 4)-(mosy / 4);
Controls
the _alpha setting of 'graphic1'
which is dependent on the mouse
position and inertia.
_root.graphic2._alpha
= 100-(mosx / 4)-(mosy / 4);
Controls
the _alpha setting of 'graphic2'
which is dependent on the mouse
position and inertia.
_root.graphic3._alpha
= (mosy / 4)-100+(mosx / 4);
Controls
the _alpha setting of 'graphic3'
which is dependent on the mouse
position and inertia.
_root.graphic4._alpha
= (mosy / 4)-(mosx / 4);
Controls
the _alpha setting of 'graphic4'
which is dependent on the mouse
position and inertia.
_root.createEmptyMovieClip("script_clip",
0);
Used
in Flash MX to create an emprty
movie clip from the _root timeline
frame.
script_clip.onLoad
= function() { };
Used
in Flash MX to make a function that
would usually be placed on a movie
clip with the 'load' handler but
instead can be placed on a _root
timeline frame.
script_clip.onEnterFrame
= function() { };
Used
in Flash MX to make a function that
would usually be placed on a movie
clip with the 'enterFrame' handler
but instead can be placed on a _root
timeline frame.
Math.ceil()
Rounds
the numbers between the ( )
brackets up to the closest integer
if not a whole number.
I divide it by 4 because the
dimensions are 400 x 400 which the
ratio of that to 100 is 4:1 so I
just divided the rounded mouse position
total by 4, so if you had a stage
500 x 500 then you would divide
by 5.
|