当前位置:中国新华电脑网校实例教程Flash实例 → 飘落的枫叶Flash动画的制作过程

飘落的枫叶Flash动画的制作过程

减小字体 增大字体 作者:佚名  来源:转载  发布时间:2008-7-29 19:15:09

 

  变形调整好之后,分别选择第1帧、第28帧、86帧、143帧、176帧,分别做动画,如图:

  到这时我们已经制作好了一个叶子的动作。插入一个图层,在最后帧处插入一关键帧,然后按F9打开动作面板,输入如下指令:

  this.removeMovieClip ();

  如图:

  按照同样的方法另外制作两个同样的动画。在此不再详细介绍。

  最后回到场景中,插入两个新的图层,选择图层2,然后按CTRL+L打开库面板,把制作好的三个叶子飘落的动画拖到舞台中,分别选择3个叶子的动画给它们命名实例名字为leaf、leaftwo、leafthree,其中命名的方法如下图:

  选择图层3的第一帧,在此我们开始编写代码控制3个动画的飘落方法。具体代码如下:

randomTime=20
i = 1;
_root.leaf._visible = 0;
_root.leaftwo._visible = 0;
_root.leafthree._visible = 0;
_root.onEnterFrame = function () {
if (random (20) == 0) {
 _root.leaf.duplicateMovieClip ("leaf"+i, i);
 _root["leaf"+i]._x = random (500)+200;
 _root["leaf"+i]._alpha = random (80)+20;
 _root["leaf"+i]._xscale = random (50)+50;
 _root["leaf"+i]._yscale = _root["leaf"+i]._xscale;
 i++;
}
if (random (20) == 0) {
 _root.leaftwo.duplicateMovieClip ("leaftwo"+i, i);
 _root["leaftwo"+i]._x = random (500)+200;
 _root["leaftwo"+i]._alpha = random (80)+20;
 _root["leaftwo"+i]._xscale = random (50)+50;
 _root["leaftwo"+i]._yscale = _root["leaftwo"+i]._xscale;
 i++;
}
if (random (20) == 0) {
 _root.leafthree.duplicateMovieClip ("leafthree"+i, i);
 _root["leafthree"+i]._x = random (500)+200;
 _root["leafthree"+i]._alpha = random (80)+20;
 _root["leafthree"+i]._xscale = random (50)+50;
 _root["leafthree"+i]._yscale = _root["leafthree"+i]._xscale;
 i++;
}
};


  在这里又做了几个类似的效果:

  最后几个的制作的方法在这里不再详述,提供给大家原文件,希望有兴趣的朋友自己去学习和研究。


上一页  [1] [2]