home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn Internet 2001 September
/
MICD2001_09_NR2.iso
/
Flash
/
Przyklady
/
Myszki.swf
/
scripts
/
frame_1
/
DoAction.as
Wrap
Text File
|
2001-07-19
|
994b
|
43 lines
function UaktualnijPozycje(mysza)
{
X = _root._xmouse - mysza._x;
Y = _root._ymouse - mysza._y;
R = Math.sqrt(X * X + Y * Y);
mysza._x += X * mysza.X_SPEED / R;
mysza._y += Y * mysza.Y_SPEED / R;
}
X_S = int(5 * Math.random());
if(X_S == 0)
{
X_S = 1;
}
Y_S = int(5 * Math.random());
if(Y_S == 0)
{
Y_S = 1;
}
Mysza.X_SPEED = X_S;
Mysza.Y_SPEED = Y_S;
R = 275 - Mysza._x;
iter = 1;
while(iter < 10)
{
Mysza.duplicateMovieClip("Mysza" add iter,iter);
eval("Mysza" add iter)._x = 275 + R * Math.cos(iter * 2 * 3.141592653589793 / 10);
eval("Mysza" add iter)._y = 200 + R * Math.sin(iter * 2 * 3.141592653589793 / 10);
X_S = int(3 * Math.random());
if(X_S == 0)
{
X_S = 1;
}
Y_S = int(3 * Math.random());
if(Y_S == 0)
{
Y_S = 1;
}
eval("Mysza" add iter).X_SPEED = X_S;
eval("Mysza" add iter).Y_SPEED = Y_S;
eval("Mysza" add iter).gotoAndPlay(4 * int(Math.random()));
iter++;
}