A bird in the flower freely fly, suddenly up and down, when fast slow, how carefree. How to achieve this effect? The following author through Flash to achieve the effect of free flying birds.
1. Create a new MC (movie clip) named Bird, and animate a bird in situ to shoot the wing fly animation (pictured).
2. Create a new layer in the scene, import the background (flowers), and make some modifications as needed.
3. Create a new layer named Bird in the scene, add two bird instances to the scene, one named Fly1, and the other one to flip through the transformation, to fly in the opposite direction, named Fly2; to overlap two instances.
Click the first frame of the bird tier timeline and enter the following code:
Qian=xia=xjia=yjia=true;
Defines a few Boolean quantities and sets the initial value to True
I=random (8);
J=random (8);
Defines the initial speed of a bird's flight
fly2._alpha=0;
Hiding the birds from the Zofei
4. Click on the second frame of the timeline, press F6 to insert a keyframe, and enter the code:
if (xjia==true) {
Accelerated x-axis direction
if (i<=12) {i+=1;}
else {xjia=false;}}
else {if (i>=0) {i-=1}
else {xjia=true; I=random (8);}};
if (yjia==true) {
if (j<=12) {j+=1;}
else {yjia=false;}}
else {if (j>=0) {j-=1}
else {yjia=true; Y=rand
OM (8);} };
if (qian==true) {
When the bird flies to the right
fly1._alpha=100;
Head to right bird show
fly2._alpha=0;
if (fly1._x<=400) {
Fly1._x=fly2._x+=i;
if (Xia) {
if (fly1._y<=300) {fly1._y=
Fly2._y+=j;}
else {xia=false;}; };
if (Xia==false) {
if (fly1._y>=20) {fly1._y=
Fly2._y-=j;}
else {xia=true;}; };
}
else {qian=false;};
};
if (Qian==false) {
fly1._alpha=0;
fly2._alpha=100;
if (fly1._x>=30) {
Fly1._x=fly2._x-=i;
if (Xia) {
if (fly1._y<=560) {fly1._y=
Fly2._y+=j; }
else {xia=false;}; };
if (Xia==false) {
if (fly1._y>=20) {fly1._y=
Fly2._y-=j;}
else {xia=true;}; };
}
else {qian=true;};
};
5. Click the timeline third frame press F6 to insert the keyframe, enter the following code: gotoAndPlay (2), and the second frame to form a loop.
So far, the animation is finished.