home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2003 April
/
Chip_2003-04_cd1.bin
/
internet
/
emerite
/
swf
/
intro.swf
/
scripts
/
frame_2
/
DoAction.as
Wrap
Text File
|
2003-02-12
|
12KB
|
566 lines
function efrm()
{
if(newColor)
{
chColor(newColor);
}
if(Math.round(r) != ang[a] and a == 1)
{
sound(2);
rx = (ang[a] - r) / 2;
r += rx;
s3._rotation += rx;
s4._rotation += rx;
sp(3,2);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 2)
{
sound(2);
rx = (ang[a] - r) / 2;
r += rx;
s4._rotation += rx;
sp(4,3);
posSeg();
}
else if(Math.round(r) != ang[a] and (a == 3 or a == 5 or a == 7 or a == 9))
{
sound(1);
rx = (ang[a] - r) / 2;
r += rx;
fwd1(rx);
}
else if(Math.round(r) != ang[a] and (a == 4 or a == 6 or a == 8 or a == 10))
{
sound(2);
rx = (ang[a] - r) / 2;
r += rx;
fwd2(rx);
}
else if(Math.round(r) != ang[a] and a == 11)
{
sound(1);
rx = (ang[a] - r) / 2;
r += rx;
s3._rotation += rx;
s2._rotation -= rx;
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 12)
{
sound(1);
rx = (ang[a] - r) / 3;
r += rx;
s1._rotation -= rx * 1.5;
s2._rotation += rx;
s3._rotation += rx / 2;
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 13)
{
sound(2);
rx = (ang[a] - r) / 3;
r += rx;
s1._rotation += rx / 3 * 7;
s4._rotation -= rx;
sp(4,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(!(Math.round(r) != ang[a] and a == 14))
{
if(Math.round(r) != ang[a] and a == 15)
{
sound(2);
rx = (ang[a] - r) / 3;
r += rx;
s4._rotation -= rx;
sp(4,3);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 16)
{
sound(1);
rx = (ang[a] - r) / 3;
r += rx;
s4._rotation -= rx / 3;
s3._rotation -= rx / 3 * 2;
sp(3,4);
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 17)
{
sound(2);
rx = (ang[a] - r) / 3;
r += rx;
s2._rotation += rx / 3 * 5;
s1._rotation -= rx;
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 18)
{
sound(2);
rx = (ang[a] - r) / 3;
r += rx;
s3._rotation -= rx;
s2._rotation += rx;
s4._rotation -= rx * 2;
sp(4,3);
sp(3,2);
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 19)
{
sound(1);
rx = (ang[a] - r) / 4;
r += rx;
s4._rotation -= rx;
s3._rotation += rx + rx / 3 * 2;
s2._rotation -= rx + rx / 6;
s1._rotation -= rx / 6 * 5;
sp(3,4);
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 20)
{
sound(2);
rx = (ang[a] - r) / 3;
r += rx;
s3._rotation += rx;
s2._rotation += rx / 2;
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 21)
{
sound(1);
rx = (ang[a] - r) / 3;
r += rx;
s4._rotation += rx;
s3._rotation -= rx;
sp(3,4);
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 22)
{
sound(2);
rx = (ang[a] - r) / 2;
r += rx;
s4._rotation -= rx * 3;
s3._rotation -= rx;
sp(4,3);
sp(3,2);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 23)
{
sound(2);
rx = (ang[a] - r) / 2;
r += rx;
_root.s4._rotation += rx;
sp(4,3);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 24)
{
sound(2);
rx = (ang[a] - r) / 3;
r += rx;
_root.s1._rotation += rx / 2;
_root.s2._rotation -= rx;
_root.s3._rotation -= rx;
_root.s4._rotation += rx / 2;
sp(4,3);
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 25)
{
sound(2);
rx = (ang[a] - r) / 3;
r += rx;
s1._rotation -= rx;
s2._rotation += rx;
s3._rotation -= rx;
s4._rotation += rx;
s2._y -= rx / 2;
sp(1,2);
sp(3,2);
sp(0,1);
sp(4,3);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 26)
{
sound(2);
rx = (ang[a] - r) / 3;
r += rx;
s1._rotation += rx;
s2._rotation -= rx;
s3._rotation += rx;
s4._rotation -= rx;
sp(1,2);
sp(3,2);
sp(0,1);
sp(4,3);
posSeg();
}
else if(Math.round(r) != ang[a] and a == 27)
{
sound(1);
rx = (ang[a] - r) / 2;
r += rx;
s1._rotation += rx;
s4._rotation -= rx;
sp(0,1);
sp(4,3);
posSeg();
}
else if(Math.round(r) != ang[a] and (a == 28 or a == 30 or a == 32 or a == 34))
{
if(a < 33)
{
sound(2);
}
rx = (ang[a] - r) / 2;
r += rx;
sfwd1();
chc = _root.blue;
}
else if(Math.round(r) != ang[a] and (a == 29 or a == 31 or a == 33))
{
sound(1);
rx = (ang[a] - r) / 2;
r += rx;
sfwd2();
}
else if(a < 36)
{
if(!a and pause < 20)
{
pause++;
}
else if(a == 12)
{
newColor = magenta;
posSeg();
reset();
}
else if(a == 13 and pause < 20)
{
pause++;
}
else if(a == 16)
{
newColor = blue;
posSeg();
reset();
}
else if(a == 17 and pause < 20)
{
pause++;
}
else if(a == 18)
{
newColor = green;
posSeg();
reset();
}
else if(a == 19 and pause < 20)
{
pause++;
}
else if(a == 21)
{
newColor = orange;
posSeg();
reset();
intro1.init_on();
intro2.init_on();
intro3.init_on();
}
else if(a == 22 and pause < 30)
{
pause++;
}
else if(a == 22)
{
_root.intro3.init_off();
reset();
}
else if(a == 23)
{
_root.intro1.init_off();
_root.intro2.init_off();
reset();
}
else if(a == 24)
{
i = 0;
while(i < 5)
{
_root["s" + i]._rotation = 0;
_root["s" + i]._y = 150;
i++;
}
intro4.init_on();
intro5.init_on();
intro6.init_on();
posSeg();
reset();
}
else if(a == 25 and pause < 30)
{
pause++;
}
else if(a == 25)
{
intro4.init_off();
intro5.init_off();
intro6.aa = true;
intro6.init_off();
posSeg();
reset();
}
else if(a == 27)
{
_root.intro6.aaa = true;
_root.intro6.dx = _root.intro6._x - _root.s2._x;
reset();
}
else if(a == 34)
{
logo.gotoAndPlay(2);
reset();
}
else if(a == 35 and pause < 60)
{
pause++;
}
else if(a == 35)
{
_root.logo.off = true;
reset();
}
else
{
posSeg();
reset();
}
}
else
{
reset_init();
}
}
}
function reset_init()
{
delete a;
ang = new Array();
ang[1] = 90;
ang[2] = 180;
i = 3;
while(i < 13)
{
ang[i] = 60;
i++;
}
ang[13] = 90;
ang[14] = 0;
ang[15] = 90;
ang[16] = 90;
ang[17] = 90;
ang[18] = 30;
ang[19] = 90;
ang[20] = 30;
ang[21] = 45;
ang[22] = 45;
ang[23] = 45;
ang[24] = 90;
ang[25] = 70;
ang[26] = 140;
i = 27;
while(i < 35)
{
ang[i] = 40;
i++;
}
orange = {rb:255,gb:153,bb:51};
blue = {rb:77,gb:127,bb:220};
magenta = {rb:207,gb:135,bb:222};
green = {rb:115,gb:187,bb:39};
grey = {rb:204,gb:204,bb:204};
intro1.ready = true;
s0._x = -165;
s1._x = -105;
s2._x = -45;
s3._x = -45;
s4._x = -45;
s0._rotation = 0;
s1._rotation = 0;
s2._rotation = 0;
s3._rotation = -90;
s4._rotation = 90;
i = 0;
while(i < 5)
{
if(i == 3)
{
this["s" + i]._y = 115;
}
else
{
this["s" + i]._y = 175;
}
i++;
}
posSeg();
newColor = grey;
}
function chColor(tc)
{
var cc = new Color(m0.c).getTransform();
var c = 0;
for(var i in "tc")
{
if(cc[i] != tc[i] and int((cc[i] - tc[i]) / 10))
{
cc[i] -= (cc[i] - tc[i]) * 0.15;
}
else
{
cc[i] = tc[i];
c++;
}
}
var i = 0;
while(i < 4)
{
new Color(this["m" + i].c).setTransform(cc);
i++;
}
if(c == 3)
{
delete newColor;
}
}
function posSeg()
{
i = 0;
while(i < 4)
{
_root["m" + i]._rotation = _root["s" + (i + 1)]._rotation;
_root["m" + i]._x = _root["s" + i]._x;
_root["m" + i]._y = _root["s" + i]._y;
i++;
}
}
function fwd1(rx)
{
_root.s4._rotation += rx;
_root.s3._rotation -= rx;
sp(3,4);
sp(2,3,true);
sp(1,2,true);
sp(0,1,true);
posSeg();
}
function fwd2(rx)
{
_root.s4._rotation -= rx;
_root.s3._rotation += rx;
sp(4,3,true);
sp(3,2);
posSeg();
}
function reset()
{
a++;
delete pause;
r = 0;
rx = 0;
}
function sp(n, m, yc)
{
if(m < n)
{
_root["s" + n]._x = _root["s" + (n - 1)]._x + 60 * Math.cos(_root["s" + n]._rotation * 3.141592653589793 / 180);
if(!yc)
{
_root["s" + n]._y = _root["s" + (n - 1)]._y + 60 * Math.sin(_root["s" + n]._rotation * 3.141592653589793 / 180);
}
}
else
{
_root["s" + n]._x = _root["s" + (n + 1)]._x - 60 * Math.cos(_root["s" + (n + 1)]._rotation * 3.141592653589793 / 180);
if(!yc)
{
_root["s" + n]._y = _root["s" + (n + 1)]._y - 60 * Math.sin(_root["s" + (n + 1)]._rotation * 3.141592653589793 / 180);
}
}
}
function sound(s)
{
if(s == 1 and ca != a)
{
snd1.start();
ca = a;
}
else if(s == 2 and ca != a)
{
snd2.start();
ca = a;
}
}
function sfwd1()
{
s1._rotation -= rx;
s2._rotation -= rx;
s3._rotation += rx;
s4._rotation += rx;
sp(4,3);
sp(2,3);
sp(1,2);
sp(0,1);
posSeg();
}
function sfwd2()
{
s1._rotation += rx;
s2._rotation += rx;
s3._rotation -= rx;
s4._rotation -= rx;
sp(0,1);
sp(2,1);
sp(3,2);
sp(4,3);
posSeg();
}
reset_init();