Flash动画例子:美丽蜻蜓飞舞

  本文中我们用Flash来制作幅蜻蜓飞舞美丽动画

  演示效果如下:



  制作步骤:

  1.新建立个Flash文档修改其属性如下图所示:

Flash动画例子:美丽蜻蜓飞舞

  2.在主场景中把图层1改名为back这是背景层我们选择矩形工具绘制个550*300矩形正好和舞台重合在这里要使用混色器面板设置线性填充效果如下图:

Flash动画例子:美丽蜻蜓飞舞

  3.的后我们新建个元件些草为了让动画效果更好你可以让草也动起来在这里我制作个静止如下图所示:

Flash动画例子:美丽蜻蜓飞舞

  4.接下来我们制作蜻蜓动画蜻蜓动画其实只是蜻蜓 4个翅膀在动所以我思路方法是先建立翅膀静止元件然后建立翅膀动元件然后组织成为个蜻蜓电影剪辑元件.绘制过程如下:

Flash动画例子:美丽蜻蜓飞舞

Flash动画例子:美丽蜻蜓飞舞

  美化下翅膀:

Flash动画例子:美丽蜻蜓飞舞

  组织成个蜻蜓把翅膀旋转下就可以了!在此不详细叙述.

Flash动画例子:美丽蜻蜓飞舞

  继续美化蜻蜓身体:

Flash动画例子:美丽蜻蜓飞舞

  美化下蜻蜓翅膀:

Flash动画例子:美丽蜻蜓飞舞

Flash动画例子:美丽蜻蜓飞舞

  组织成个效果较好蜻蜓:

Flash动画例子:美丽蜻蜓飞舞

  5.这时我们新建立个电影剪辑元件命名为trans绘制个小白色矩形效果如下(注意我已经将显示比例调到了200%):

Flash动画例子:美丽蜻蜓飞舞

  6.回到主场景新添加个"草"层然后把我们制作草拖出来连续拖出两次使草看起来错综复杂效果如下:

Flash动画例子:美丽蜻蜓飞舞

  7.新建立个图层"蜻蜓"然后把蜻蜓电影剪辑从酷中拖出来依次重复5次打开属性面板分别给蜻蜓命名例子名为fly1fly2fly3fly4fly5效果如下:

Flash动画例子:美丽蜻蜓飞舞

  8.新建立个图层"trans"然后把蜻蜓电影剪辑从酷中拖出来依次重复5次打开属性面板分别给蜻蜓命名例子名为transp1transp2transp3transp4transp5效果如下:

Flash动画例子:美丽蜻蜓飞舞

  9.新建立个图层"action"按F9打开动作面板添加如下AS代码:probability = 30;
scene_width = 550;
scene_height = 300;
speed = 0.03;
MovieClip.prototype.smoothMove = function (speed, targetx, targety) {
this._x speed*(targetx-this._x);
this._y speed*(targety-this._y);
};
MovieClip.prototype.rotateTo = function (targetx, targety) {
var dfX = targetx-this._x;
var dfY = targety-this._y;
this._rotation = Math.atan2 (dfY, dfX)*180/Math.PI;
};
_root.transp1.onEnterFrame = function {
(random (probability) 0) {
 target1X = random (scene_width);
 target1Y = random (scene_height);
}
this._visible = 0;
this.smoothMove (speed, target1X, target1Y);
};
_root.fly1.onEnterFrame = function {
this.smoothMove (speed, transp1._x, _root.transp1._y);
this.rotateTo (_root.transp1._x, _root.transp1._y);
};
_root.transp2.onEnterFrame = function {
(random (probability) 0) {
 target2X = random (scene_width);
 target2Y = random (scene_height);
}
this._visible = 0;
this.smoothMove (speed, target2X, target2Y);
};
_root.fly2.onEnterFrame = function {
this.smoothMove (speed, transp2._x, _root.transp2._y);
this.rotateTo (_root.transp2._x, _root.transp2._y);
};
_root.transp3.onEnterFrame = function {
(random (probability) 0) {
 target3X = random (scene_width);
 target3Y = random (scene_height);
}
this._visible = 0;
this.smoothMove (speed, target3X, target3Y);
};
_root.fly3.onEnterFrame = function {
this.smoothMove (speed, transp3._x, _root.transp3._y);
this.rotateTo (_root.transp3._x, _root.transp3._y);
};
_root.transp4.onEnterFrame = function {
(random (probability) 0) {
 target4X = random (scene_width);
 target4Y = random (scene_height);
}
this._visible = 0;
this.smoothMove (speed, target4X, target4Y);
};
_root.fly4.onEnterFrame = function {
this.smoothMove (speed, transp4._x, _root.transp4._y);
this.rotateTo (_root.transp4._x, _root.transp4._y);
};
_root.transp5.onEnterFrame = function {
(random (probability) 0) {
 target5X = random (scene_width);
 target5Y = random (scene_height);
}
this._visible = 0;
this.smoothMove (speed, target5X, target5Y);
};
_root.fly5.onEnterFrame = function {
this.smoothMove (speed, transp5._x, _root.transp5._y);
this.rotateTo (_root.transp5._x, _root.transp5._y);
};
  10.时间轴最终效果如下图所示:



Flash动画例子:美丽蜻蜓飞舞

  例子讲解完成!



Tags: 

延伸阅读

最新评论

发表评论