Demo Effect:
Click here to download the source file
Production steps:
1. Create a new flash document and modify its properties as shown in the following illustration:
2. Change the layer 1 to back in the home scene, this is the background layer, we choose the Rectangle tool to draw a 550*300 rectangle just coincides with the stage, where you want to use the Color mixer panel, set the linear fill effect the following figure:
3. Then we create a new component, draw some grass, in order to make the animation more effective you can let the grass also move, where I made a still diagram, as shown in the following figure:
4. Next we make Dragonfly animation, Dragonfly animation is actually only the Dragonfly's four wings in motion, so my method is to build the wings still components, and then build wings moving components, and then organized into a Dragonfly film clip components. The drawing process is as follows:
To beautify the wings:
Organize yourself into a dragonfly, rotate your wings and you can do it! Not described in detail here.
Continue to beautify the Dragonfly body:
Beautify the wings of the Dragonfly:
Tissue into a dragonfly with better results:
5. At this time we create a new movie clip symbol, named Trans, draw a small white rectangle, the effect is as follows (note I have the zoom to 200%):
6. Back to the main scene, add a new "grass" layer, and then drag our production of grass out of the continuous drag out two times, so that the grass looks complex, the effect is as follows:
7. Create a new layer "Dragonfly", and then drag the Dragonfly movie clips from the cool, repeat 5 times, open the property panel, respectively, to the Dragonfly named instance name Fly1,fly2,fly3,fly4,fly5, the effect is as follows:
8. Create a new layer "trans", and then drag the Dragonfly movie clips from the cool, repeat 5 times, open the property panel, respectively, to the Dragonfly named instance name TRANSP1,TRANSP2,TRANSP3,TRANSP4,TRANSP5, the effect is as follows:
9. Create a new layer "action", press F9 to open the action panel to add the following instruction code:
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 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);
This.rotateto (_root.transp3._x, _root.transp3._y);
};
_root.transp4.onenterframe = function () {
if (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 () {
if (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. The final effect of the timeline is as shown in the following illustration:
Example explanation complete! I wish you good luck, there is no understanding of the place you can contact me: qq:76312395