毕业论文 论文提纲 论文写作 公文范例 教育论文 教育学论文 师范教育 学术论文     论文指导*
                     
 
   
   
   
   
           
 

当前位置:课件115学培吧(kj115.com)→flash网侠教程(助你成为顶尖课件高手)→系列文章

 
 
标题:Flash AS制作下雪动画效果
 
展示台

文章来源 作者:admin 密码:admin 整理:湖北金鹰

◇网侠教程栏目简介
    提供FLASH侠客教程和网页制作侠客教程,高手进阶教程。
    浏览过这些资源的还浏览过经典教程图文教程游戏开发教程等相关资源。

---------------

湖北金鹰课件吧

论文相关服务
 

 

使用纯Flash Actionscript实现的下雪动画效果。
制作方法是把下面的代码直接放到新建立的Flash文档的第1帧里面:
function addMasker(){
_root.createEmptyMovieClip("masker", -2);
with (masker)
{
lineStyle(1, 13421772, 100);
beginFill(0, 100);
moveTo(sideDisWidth, sideDisHeight);
lineTo(sideDisWidth + sceneWidth, sideDisHeight);
lineTo(sideDisWidth + sceneWidth, sideDisHeight + sceneHeight);
lineTo(sideDisWidth, sideDisHeight + sceneHeight);
endFill();
} // End of with
createSnow();
} // End of the function
function createSnow()
{
var _l1 = 0;
while (_l1 < snowNum)
{
var _l2 = snowSpace.createEmptyMovieClip("s" + _l1, _l1);
var _l3 = Math.random() * 3;
drawSnow(_l2, _l3);
_l1++;
} // end while
} // End of the function
function drawSnow(snow, radius)
{
var p = radius * 0.900000;
with (snow)
{
colors = [13421772, 16777215];
alphas = [100, 100];
ratios = [0, 255];
matrix = {matrixType: "box", x: -Math.random() * 2 * radius, y: -Math.random() * 2 * radius, w: 2 * radius, h: 2 * radius, r: 1.570796};
beginGradientFill("radial", colors, alphas, ratios, matrix);
curveTo(p, -p, radius, 0);
curveTo(p, p, 0, radius);
curveTo(-p, p, -radius, 0);
curveTo(-p, -p, 0, -radius);
endFill();} // End of with
snowProperty(snow, sceneWidth, sceneHeight);
} // End of the function
function snowProperty(snow, w, h)
{
snow._x = sideDisWidth + Math.random() * w;
snow._y = sideDisHeight + Math.random() * h;
snow._rotation = Math.random() * 120 + 30;
snow.stepX = Math.cos(snow._rotation * 3.141593 / 180);
snow.stepY = Math.random() * 2 + 1;
setInterval(snowFall, 30, snow);
} // End of the function
function snowFall(snow)
{
snow._x = snow._x + snow.stepX;
snow._y = snow._y + snow.stepY;
if (sideDisWidth > snow._x)
{
snow._x = sideDisWidth + sceneWidth;
} // end if
if (sideDisWidth + sceneWidth < snow._x)
{
snow._x = sideDisWidth;
} // end if
if (sideDisHeight + sceneHeight < snow._y)
{
snow._y = sideDisHeight;
} // end if
} // End of the function
var sceneWidth = 550;
var sceneHeight = 400;
var sideDisWidth = Stage.width / 2 - sceneWidth / 2;
var sideDisHeight = Stage.height / 2 - sceneHeight / 2;
var snowNum = 150;
var snowSpace = _root.createEmptyMovieClip("room", 1);
addMasker();
right">

 

 
课件115学培吧(湖北金鹰)欢迎您!永久免费服务网址:http://www.kj115.com
   
 

学员众多的FLASH课件学习基地,成万免费FLASH课件制作教程在线学习,还有免费内容课件教程、视频教程、课件技巧、课件探讨、课件欣赏、课件展示、实用教程、课件界面、课件脚本、课件游戏、课件下载、课件封面、课文内容图片、课文人物图片库、课件素材、图片素材、声音素材、动物素材、背景图片、背景资料、背景边框、课件顶栏图片素材、Dreamweaver教程、Dreamweaver网页课件教程、软件下载。承接学习和培训,承接课件订制,课件修改等所有课件相关服务。
本站主要业务:┃flash课件制作视频教程培训┃承接全国竞赛flash课件┃论文代写代发┃代办课件国家级获奖证书┃
联系:QQ:444860709 手机:13339817386


 
 

业务办理
鄂ICP备08005724号