Flash8 make a continuous rise of transparent bubble animation

Source: Internet
Author: User
Transparent

This tutorial focuses on action Script, and each statement is basically commented! Download the source file with Flash version 8 or more to open to edit.

Effect Demo:

Click here to download the source file (decompression password: www.webjx.com)

We use the copy statement of as as the number of blisters, the use of setting properties to change the transparency, size and so on. Finally, set the blisters in the movie clip left and right swing. This combination, you can achieve the effect of bubble rise.

  Specific Steps

1, open Flash 8 Create a new document. and modify the document properties appropriately (400x300, blue background)

2, build a movie clip, named "Popo". After entering the editor, use the drawing tool to draw a blister with the gradient fill. As shown in the figure.

3, back to the main scene, the layer 1 named "Popo." Drag the "Popo" movie clip from the library to the bottom of the scene, and name it "H2O" in the following property panel. As shown in the figure.

4. Create a new layer in the main scene, named as. Add as as (the explanations for each statement are explained) in frame 1th:

I=1//initialization variables
while (i<=30) {//To control the amount of water droplets
Duplicatemovieclip ("H2O", "H2O" +i,i); Copy water droplets
SetProperty ("H2O" +i,_x,random (400)); Randomly distributed droplets on the x axis
SetProperty ("H2O" +i,_y,random (100) +300); Ditto, just replaced by the Y axis
SetProperty ("H2O" +i,_xscale,random (60) +40);
SetProperty ("H2O" +i,_yscale,getproperty (eval ("H2O" +i), _xscale));
The above two as is used to control the size of water droplets.
SetProperty ("H2O" +i,_alpha,random (30) +70);/To control the transparency of water droplets
i++
}
_root.h2o._visible=0//Hide the water droplets from the main scene.

5, select the movie clip "Popo", add as (each statement has been explained):

Onclipevent (load) {//To randomly assign to the speed of water droplets, Jean movement more realistic.
Speed = random (5) +3;
}
Onclipevent (enterframe) {
This._y-= speed; To change the coordinates of the y-axis of the water droplets so that we look like the droplets are constantly rising.
This._x + = random (3)-random (3); For the Pearl movement in Sheung Shui is more realistic, we are shaking around the water bead.
The IF (this._y<-15) {//This if statement is to be put back into the screen when the drops are removed from the screen.
this._y = random (100) +315;
}
}

The layout of the last timeline;

After saving, press Ctrl+enter test!



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.