iphone搜狗输入法震动:FLASH中蝴蝶如何制造?要动态

来源:百度文库 编辑:高校问答 时间:2024/04/28 06:49:06
FLASH中蝴蝶如何制造?要动态

在需要的帧里插入:
蝴蝶的颤翅自己设计
probability = 100;

scene_width = 500;
scene_height = 290;
speed = 0.03;
depth = 15;
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.transp0.onEnterFrame = function () {
if (random (probability) == 1) {
target0X = random (scene_width);
target0Y = random (scene_height);
}
this._visible = 0;
this.smoothMove (speed, target0X, target0Y);
};
_root.transp1.onEnterFrame = function () {
if (random (probability) == 1) {
target1X = random (scene_width);
target1Y = random (scene_height);
}
this._visible = 0;
this.smoothMove (speed, target1X, target1Y);
};
_root.fly0_mc.onEnterFrame = function () {
this.smoothMove (speed, transp0._x, _root.transp0._y);
this.rotateTo (_root.transp0._x, _root.transp0._y);
};
_root.fly1_mc.onEnterFrame = function () {
this.smoothMove (speed, transp1._x, _root.transp1._y);
this.rotateTo (_root.transp1._x, _root.transp1._y);
};
_root.shadow0_mc.onEnterFrame = function () {
this.smoothMove (speed, transp0._x, _root.transp0._y+depth);
this.rotateTo (_root.transp0._x, _root.transp0._y+depth);
};
_root.shadow1_mc.onEnterFrame = function () {
this.smoothMove (speed, transp1._x, _root.transp1._y+depth);
this.rotateTo (_root.transp1._x, _root.transp1._y+depth);
};

你可以去源代码中心找一些不同展翅的蝴蝶
在flash里设计不同的帧就好了

晕 需要这么复杂吗 搞这些程序有啥用吧
你就把翅膀分离下来 多加几个图层 粘贴 剪接慢慢来就行了

最简单的方法多勾几个各种支式的蝴蝶出来就行了。

厉害!

参考初级中学信息技术地一册第一课就OK了