欢迎大家光临【无师自通-教程网】您的到来是我们的荣幸。本站提供photoshop教程,ps教程,flash教程,cad教程,网页制作教程,excel教程,asp教程,vb教程,3d教程,c语言教程,html教程,coreldraw教程,dreamweaver教程,java教程,3dmax教程 等各种教程为主题的内容和服务,相信您会在这里找到您所需要的东东。无师自通伴您一生-谢谢您的光临!!
网站地图 设为首页
简繁切换 加入收藏
栏目待定 留言本站
您现在的位置: 无师自通-教程网 >> 多媒体动画 >> Flash教程 >> Flash游戏实例教程 >> 教程正文

  没有公告

教程: Flash教程-Flash游戏实例教程-Flash中背景跟随时间变化 更多...
教程: Flash教程-Flash游戏实例教程-Flash中背景跟随时间变化

1110)
{
skycolor = [83 - (nowtime - 1080) * 0.433000, 111 - (nowtime - 1080) * 5.100000, 83 - (nowtime - 1080) * 0.433000, -5 - (nowtime - 1080) * 1.233000, 65 (nowtime - 1080) * 0.366700, 13 - (nowtime - 1080) * 2, 100, 0];
} // end if
if (nowtime > 1110 && nowtime <= 1200)
{
skycolor = [70 - (nowtime - 1110) * 0.722000, -42 (nowtime - 1110) * 0.667000, 70 - (nowtime - 1110) * 0.700000, -42 (nowtime - 1110) * 0.310000, 76 - (nowtime - 1110) * 0.522000, -47 (nowtime - 1110) * 0.411000, 100, 0];
} // end if
sk = new Color(sky);
x1 = ;
sk.setTransform(x1);
m1 = new Color(mc1);
x2 = ;
m1.setTransform(x2);
m2 = new Color(mc2);
x3 = ;
m2.setTransform(x3);
m3 = new Color(mc3);
x4 = ;
m3.setTransform(x4);
m4 = new Color(mc4);
x5 = ;
m4.setTransform(x5);
d = new Color(dao);
x6 = ;
d.setTransform(x6);
y1 = new Color(yun1);
y2 = new Color(yun2);
y3 = new Color(yun3);
sun = new Color(mc5);
x7 = ;
y1.setTransform(x7);
y2.setTransform(x7);
y3.setTransform(x7);
sun = new Color(mc5);
sun.setTransform(x4);
sky2 = new Color(_root.home.all.sky2);
sky2.setTransform(x1);
} // End of the function
function suntimes()
{
if (nowtime >= 540 && nowtime <= 900)
{
mc5._y = -45;
if (nowtime <= 720)
{
mc5._rotation = 180 (nowtime - 540) * 0.388000;
} // end if
if (nowtime > 720)
{
mc5._rotation = 250 (nowtime - 720) * 0.611000;
} // end if
}
else
{
if (nowtime < 540 && nowtime >= 360)
{
mc5._y = 180 - (nowtime - 360) * 1.250000;
mc5._rotation = 180;
} // end if
if (nowtime >= 900 && nowtime <= 1110)
{
mc5._y = -45 (nowtime - 900) * 0.900000;
mc5._rotation = 0;
} // end if
if (nowtime >= 0 && nowtime < 360 || nowtime > 1100 && nowtime <= 1440)
{
mc5._alpha = 0;
}
else
{
mc5._alpha = 100;
} // end if
} // end if
if (nowtime > 360 && nowtime <= 720)
{
mc5.sun._xscale = 130 - (nowtime - 360) * 0.166700;
mc5.sun._yscale = mc5.sun._xscale;
}
else if (nowtime > 720 && nowtime <= 1080)
{
mc5.sun._xscale = 70 (nowtime - 720) * 0.166700;
mc5.sun._yscale = mc5.sun._xscale;
} // end if
} // End of the function
function moontimes()
{
if (nowtime >= 1260 && nowtime < 1440 || nowtime >= 0 && nowtime < 180)
{
moon._y = -45;
if (nowtime < 1440)
{
moon._rotation = 180 (nowtime - 1260) * 0.388900;
} // end if
if (nowtime >= 0 && nowtime < 180)
{
moon._rotation = 250 nowtime * 0.611000;
} // end if
}
else
{
if (nowtime < 1260 && nowtime > 1080)
{
moon._y = 75 - (nowtime - 1080) * 0.666700;
moon._rotation = 180;
} // end if
if (nowtime > 180 && nowtime < 1080)
{
moon._y = -45 (nowtime - 180) * 0.666700;
moon._rotation = 0;
} // end if
} // end if
if (nowtime >= 1080 && nowtime <= 1260)
{
moon._alpha = Math.round((nowtime - 1080) * 0.555600);
star._alpha = Math.round((nowtime - 1080) * 0.555600);
} // end if
if (nowtime > 1260 && nowtime < 1440 || nowtime > 0 && nowtime < 240)
{
moon._alpha = 100;
star._alpha = 100;
} // end if
if (nowtime >= 240 && nowtime <= 360)
{
moon._alpha = 100 - Math.round((nowtime - 240) * 0.833300);
star._alpha = 100 - Math.round((nowtime - 240) * 0.833300);
} // end if
if (nowtime > 360 && nowtime < 1080)
{
moon._alpha = 0;
star._alpha = 0;
} // end if
if (nowtime > 1080 && nowtime < 1440)
{
moon.moons._xscale = 130 - (nowtime - 1080) * 0.138890;
moon.moons._yscale = moon.moons._xscale;
}
else if (nowtime > 0 && nowtime <= 360)
{
moon.moons._xscale = 80 nowtime * 0.138890;
moon.moons._yscale = moon.moons._xscale;
} // end if
} // End of the function
var hh;
var xiaoshi;
var mm;
var ss;
var fengzhong;
var nowtime;
MovieClip.prototype.moveIn = function ()
{
var _l1 = this;
_l1.onEnterFrame = function ()
{
var _l1 = this;
if (_l1._currentframe < _l1._totalframes)
{
_l1.nextFrame();
}
else
{
delete _l1["onEnterFrame"];
} // end if
};
};
MovieClip.prototype.moveOut = function ()
{
var _l1 = this;
_l1.gotoAndStop(_l1._totalframes);
_l1.onEnterFrame = function ()
{
var _l1 = this;
if (_l1._currentframe > 1)
{
_l1.prevFrame();
}
else
{
delete _l1["onEnterFrame"];
} // end if
};
};
onEnterFrame = function ()
{
ss = new Date();
miao = ss.getSeconds();
if (miao == 59)
{
times();
suntimes();
moontimes();
} // end if
};

特别说明:这个代码最下面不是用来控制背景变化的,而是用来控制到了晚上月亮出现的位置,星星的位置。白天这些画面消失的控制。由于时间缘故。本人没有将这些画面放上了。如果大家感兴趣的话。我后面会完成的。



上一页  [1] [2] [3] 下一页

教程录入:admin    责任编辑:admin 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
     
     
     
     

    3DsMAX实例制作:三维玻璃灯泡

    3dmax在线教程--蝴蝶

    3ds max时尚水晶鞋

    精彩Flash制作风吹草动效果动画

    教程: 3DS Max-设计实例-三维虚拟…

    3dmax7.0教程--火焰特效

    绘画技巧:Flash绘制人头造型

    3ds max 室内设计---室内效果图
    免责声明!本站资料大部分来自于互联网,其版权归原作者或其他合法者所有.如内容涉及或侵犯了您的权益,请通知本人,我将尽快处理!.欢迎您的光临。
    辽ICP备07003958号
    无师自通,伴你一生-教程网