纳金网
标题:
Flash 3D旋转时钟制作教程
[打印本页]
作者:
.
时间:
2012-12-21 14:36
标题:
Flash 3D旋转时钟制作教程
第一帧:内有一个影片剪辑Symbol2的实例c1
function pT()
{
tt = new Date();
h1 = tt.getHours();
h2 = h1 % 10;
h1 = Math.floor(h1 / 10);
m1 = tt.getMinutes();
m2 = m1 % 10;
m1 = Math.floor(m1 / 10);
s1 = tt.getSeconds();
s2 = s1 % 10;
s1 = Math.floor(s1 / 10);
dS(h1, h2, m1, m2, s1, s2);
dR3();
Ry = (Ry + Sy) % 360;
Rx = (Rx + Sx) % 360;
} // End of the function
function dS(pr0, pr1, pr2, pr3, pr4, pr5)
{
go = 0;
j = 4;
for (i = 0; i < 6; i++)
{
if (Cd
!= eval("pr" + i))
{
go = 1;
} // end if
if (go)
{
Cd
= eval("pr" + i);
xx = i * 6;
if (i > 1)
{
xx = xx + 2;
} // end if
if (i > 3)
{
xx = xx + 2;
} // end if
for (k = 0; k < dgts[Cd
].length; k++)
{
dx[j] = xx + (dgts[Cd
][k] - 1) % 5;
dy[j] = Math.ceil(dgts[Cd
][k] / 5) - 4;
j++;
} // end of for
continue;
} // end if
j = j + dgts[Cd
].length;
} // end of for
nnv = j;
} // End of the function
function dR3()
{
for (i = 0; i < 118; i++)
{
if (i < nnv)
{
a = (dx
* Pa + Ry) / 180 * 3.141593;
x = Math.cos(a) * Pr;
ez
= Math.sin(a) * Pr;
y = dy
* Py;
a = Rx / 180 * 3.141593;
s = Math.sin(a);
c = Math.cos(a);
ex
= c * x - s * y;
ey
= s * x + c * y;
} // end if
} // end of for
for (i = 0; i < 118; i++)
{
d = "d" + (i + 1);
if (i < nnv)
{
if (i >= nv)
{
setProperty(d, _visible, ***e);
} // end if
setProperty(d, _x, ex
/ (ez
+ Dz) * Dz + Cx);
setProperty(d, _y, ey
/ (ez
+ Dz) * Dz + Cy);
setProperty(d, _width, Bs / (ez
+ Dz) * Dz);
setProperty(d, _height, Bs / (ez
+ Dz) * Dz);
setProperty(d, _alpha, (ez
/ -Pr + 1) * 60 + 40);
continue;
} // end if
setProperty(d, _visible, false);
} // end of for
nv = nnv;
} // End of the function
for (i = 1; i < 119; i++)
{
d = "d" + i;
duplicateMovieClip("c1", d, i);
setProperty(d, _x, i);
setProperty(d, _y, i * 3);
} // end of for
setProperty("c1", _visible, false);
dgts = new Array(10);
dgts[0] = new Array(2, 3, 4, 6, 10, 11, 14, 15, 16, 18, 20, 21, 22, 25, 26, 30, 32, 33, 34);
dgts[1] = new Array(3, 7, 8, 13, 18, 23, 28, 32, 33, 34);
dgts[2] = new Array(2, 3, 4, 6, 10, 15, 19, 23, 27, 31, 32, 33, 34, 35);
dgts[3] = new Array(1, 2, 3, 4, 5, 9, 13, 19, 25, 26, 30, 32, 33, 34);
dgts[4] = new Array(4, 8, 9, 12, 14, 16, 19, 21, 22, 23, 24, 25, 29, 34);
dgts[5] = new Array(1, 2, 3, 4, 5, 6, 11, 12, 13, 14, 20, 25, 26, 30, 32, 33, 34);
dgts[6] = new Array(3, 4, 7, 11, 16, 17, 18, 19, 21, 25, 26, 30, 32, 33, 34);
dgts[7] = new Array(1, 2, 3, 4, 5, 10, 14, 18, 22, 27, 32);
dgts[8] = new Array(2, 3, 4, 6, 10, 11, 15, 17, 18, 19, 21, 25, 26, 30, 32, 33, 34);
dgts[9] = new Array(2, 3, 4, 6, 10, 11, 15, 17, 18, 19, 20, 25, 29, 32, 33);
Cd = new Array(6);
dx = new Array(118);
dy = new Array(118);
dx[0] = 12;
dy[0] = -1;
dx[1] = 12;
dy[1] = 1;
dx[2] = 26;
dy[2] = -1;
dx[3] = 26;
dy[3] = 1;
nv = 118;
nnv = 4;
Pr = 130;
Pa = 4;
Py = 9;
Bs = 7;
Sy = -4;
Ry = 0;
Rx = 0;
Sx = 1.320000;
ex = new Array(118);
ey = new Array(118);
ez = new Array(118);
k = 0;
Dz = 500;
Cx = _root._width / 2;
Cy = _root._height / 2;
pT();第二帧:内有一个影片剪辑Symbol2的实例
pT();第三帧:内有一个影片剪辑Symbol2的实例
gotoAndPlay(2);【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/
欢迎光临 纳金网 (http://wwww.narkii.com/club/)
Powered by Discuz! X2.5