Flash制作美丽的蜻蜓飞舞效果动画
作者 佚名技术
来源 服务器技术
浏览
发布时间 2012-07-11
演示效果: ![]() ![]() 制作步骤: 1.新建立一个Flash文档,修改其属性如下图所示: ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 diffX = targetx-this._x; var diffY = targety-this._y; this._rotation = Math.atan2 (diffY, diffX)*180/Math.PI; }; _root.transp1.onEnterFrame = function () { if (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 () { if (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 () { if (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); |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: 环绕立体图片效果下一篇: 金闪客AS课堂实录二
关于Flash制作美丽的蜻蜓飞舞效果动画的所有评论