Current location - Music Encyclopedia - Dating - How to do the flash flowering effect? Urgent ~ ~ ~ ~
How to do the flash flowering effect? Urgent ~ ~ ~ ~
1。 Create a new Flash document, and the stage defaults.

2。 Insert a new movie clip symbol named Backlight. Edit in the component, click the first frame, select the rectangle tool, turn off the brush stroke, turn on the fill, and radiate. Choose any color of the same color system, and the color scale is light on the left and dark on the right. On the stage, draw a 550X400 rectangle, which is aligned horizontally and vertically. Insert a key frame in the fourth frame, or the color code is light on the left and deep on the right, and change the rectangle just drawn into another color. In the 9th frame, 14 frame and 19 frame, the rectangle is changed to a different color than in the 4th frame. Then insert key frames in the 5th frame, 10 frame, 15 frame and 20th frame respectively. Select interpolation animation in frames 1, 5, 10 and 15 respectively.

3. Insert a new movie clip symbol named ellipse. Edit and add Layer 2 in the assembly. Click the first frame of layer 1 and layer 2 respectively, and use the ellipse tool to select any solid color. Draw two ellipses of different colors on the stage, one large and one small, which are both horizontally aligned and vertically aligned.

4. Create a new movie clip component named Button. Enter the button component editing, click "Click" on the 1 layer, and drag into a cartoon animation film editing component prepared in advance, or you can draw a beautiful flower yourself, horizontally and vertically aligned.

5。 Insert a new movie clip symbol named: Text Description. Edit in the component, use the text tool on the stage, the font size is 15, yellow, input: click the villain button repeatedly, and different flowers will bloom. The word "villain" depends on the button graphic you choose.

6。 Go back to the scene 1. Rename the layer to 1 as the background, click the first frame, drag it to the editing element of the background light film in the library, align it horizontally and vertically, and lock it. Add Layer 2, name it ellipse, click the first frame of Layer 2, drag it to the ellipse component in the library, place it at the low point of the stage, align it horizontally, and lock it. Add Layer 3 and name it button. Click the first frame of Layer 3, drag it to the button component in the library and put it in the lower right corner. Because this button has only a faint shadow on the stage, it can't be seen when playing, so create a new layer 4, name it a copy of the button, click the first frame, drag it into the cartoon animation movie clip element for making the button, and put it in the position overlapping with the button shadow of layer 3. Add layer 5, named caption, click the first frame, drag it to the caption component in the library, and place it under the ellipse of the stage, and align it horizontally. Add layer 6 and name it. Click the first frame to open the action panel and enter the following command: function initFlower ().

{

FLOOR_POS = flowerDot_mc。 _ y- 1;

fNum =- 1;

tipScale = grow scale = tipSlow = grow slow = 0;

Flowers = false;

Growth = true;

Huadian _mc _ visible = false

tip = new Array();

c 1 = new Array();

C2 = new Array();

m 1 = new Array();

m2 = new Array();

C3 = new Array();

C4 = new Array();

this . createemptymovieclip(" flower _ MC ",0);

Flower _mc. _x = flowerDot_mc。 _ x;

leaf total = int(rnd()* 5)+3;

leaf length = rnd()* 80+20;

Leaf width = leaf length/total leaves * 3.141593e+000 * rnd ();

leaf nextnum = leaf num = int(rnd()* leaf color . length);

petalNextNum = petal num = int(rnd()* petal color . length);

midNum = int(rnd()* mid color . length);

flower _ Color = new Color(" flowerDot _ MC ");

flower _ color . set RGB(leaf line[leaf num]);

}//End of function

Function newFlower ()

{

Huadian _mc _ visible = true

if (fNum == 1)

{

Flower = true;

}//End if

if (fNum == 2)

{

Growth = false;

Return;

}//End if

++ fNum;

flower _ MC . createemptymovieclip(fNum,fNum)。 createEmptyMovieClip("stem_mc ",- 1);

flower_mc[fNum]。 ox = 0;

flower_mc[fNum]。 oy = fNum == 0? (FLOOR _ POS):(flower _ MC[fNum- 1]。 oy);

Tip[fNum] = new array ();

c 1[fNum]= new Array();

C2[fNum]= new Array();

m 1[fNum]= new Array();

m2[fNum]= new Array();

C3[fNum]= new Array();

C4[fNum]= new Array();

var _ loc 18 = rnd()* 1.500000 e+000;

var _ loc 16 = rnd()* 1.500000 e+000;

var _ loc 17 = rnd()* 1.500000 e+000;

var _ loc 14 = rnd()* 4.000000 e-00 1+2.000000 e-00 1;

var _ loc 15 = rnd()* 4.000000 e-00 1+6.0000000 e-00 1;

var _ loc 13 = rnd()* 9.000000 e-00 1+ 1.000000 e-00 1;

if(_ loc 13 & lt; 2.000000E-00 1)

{

_ loc 14 = 0;

_ loc 15 = 0;

_ loc 13 = 0;

}//End if

If (flowers)

{

var _ loc 24 = rnd()* 80- 100;

var _ loc 23 = 0;

var _ loc 2 1 = rnd()* 100-50;

var _ loc 22 = 0;

leaf total = int(rnd()* 7)+3;

leaf length = rnd()* 80+20;

leaf width = leaf width+20;

}

other

{

_ loc 24 = rnd()* 80-40;

_ loc 23 = rnd()* 40-20;

_ loc 2 1 = rnd()* 40-20;

_ loc 22 = rnd()* 30- 15;

}//End else if

tip scale = 0;

tipSlow = 5.000000 e-002;

grow scale = 2.500000 e-00 1;

grow slow = 5.000000 e-002;

var _ loc 1 = leaf total;

while (_loc 1 -)

{

var _ loc 7 = _ loc 1/leaf total * 6.283 185 e+000;

tip[fNum][_ loc 1]= new Vertex(cos(_ loc 7)* leaf length,sin(_loc7) * leafLength,_ loc 24);

var _ loc 6 = tip[fNum][_ loc 1]。 x;

var _ loc 8 = tip[fNum][_ loc 1]。 y;

var _ loc 10 = cos(_ loc 7- 1.570796 e+000);

var _ loc 12 = cos(_ loc 7+ 1.570796 e+000);

var _ loc 1 1 = sin(_ loc 7- 1.570796 e+000);

var _ loc 9 = sin(_ loc 7+ 1.570796 e+000);

C 1[fNum][_loc 1] = new vertex (_ loc6 * _ loc14+_ loc10 * leaf width * _loc 18, _ loc8.

C2[fNum][_loc 1] = new vertex (_ loc6 * _ loc15+_ loc10 * leaf width * _loc 16, _ loc8 * _ loc/kloc.

M 1[fNum][_loc 1] = new vertex (_ loc6 * _ loc13+_ loc10 * leaf width * _loc 17, _ loc8.

M2[fNum][_loc 1] = new vertex (_ loc6 * _ loc13+_ loc12 * leaf width * _ loc17, _ loc8 * _ loc/kloc.

C3[fNum][_loc 1] = new vertex (_ loc6 * _ loc15+_ loc12 * leaf width * _ loc16, _ loc8 * _ loc/kloc.

C4[fNum][_loc 1] = new vertex (_ loc6 * _ loc14+_ loc12 * leaf width * _ loc18, _ loc8 * _ loc/kloc.

Var _loc20 = flowers? (-7.853980 e-00 1):(- 1.570796 e+000);

var _ loc 19 = 0;

var _ loc 4 = cos(_ loc 20);

var _ loc 5 = sin(_ loc 20);

var _ loc 2 = cos(_ loc 19);

var _ loc 3 = sin(_ loc 19);

Prompt [fNum][_loc 1]. Rotation (_loc2, _loc3, _loc4, _ loc5);

c 1[fNum][_loc 1]。 Rotation (_loc2, _loc3, _loc4, _ loc5);

c2[fNum][_loc 1]。 Rotation (_loc2, _loc3, _loc4, _ loc5);

m 1[fNum][_loc 1]。 Rotation (_loc2, _loc3, _loc4, _ loc5);

m2[fNum][_loc 1]。 Rotation (_loc2, _loc3, _loc4, _ loc5);

c3[fNum][_loc 1]。 Rotation (_loc2, _loc3, _loc4, _ loc5);

c4[fNum][_loc 1]。 Rotation (_loc2, _loc3, _loc4, _ loc5);

Prompt [fNum][_loc 1]. Tip scale;

c 1[fNum][_loc 1]。 Growth scale;

c2[fNum][_loc 1]。 Growth scale;

m 1[fNum][_loc 1]。 Growth scale;

m2[fNum][_loc 1]。 Growth scale;

c3[fNum][_loc 1]。 Growth scale;

c4[fNum][_loc 1]。 Growth scale;

flower_mc[fNum]。 createEmptyMovieClip(_ loc 1,_ loc 1);

}//End time

}//End of function

Function updateFlower ()

{

flower_mc[fNum]。 oy = flower_mc[fNum]。 Oy-sin (growth scale * 3.141593e+000) * leaf length/24;

var FX = 0;

var fy = flower_mc[fNum]。 oy;

Var slow = flowers? (-5.000000 e-004):(tipSlow *- 1.000000 e-002);

var ax = flower_mc。 _ xmouse * slow

var ay = 0;

var cy = cos(ay);

var sy = sin(ay);

var CX = cos(ax);

var sx = sin(ax);

var h = abs(flower_mc[fNum].getBounds(flower_mc)。 yMin-fy)* 2;

with (flower_mc[fNum].stem_mc)

{

clear();

lineStyle(3,leaf line[leaf num]);

moveTo(0,fNum == 0? (FLOOR _ POS):(flower _ MC[fNum- 1]。 oy));

lineTo(0,fy);

}//ends with

if(grow scale & lt; 1)

{

grow slow = grow slow * 9.500000 e-00 1;

grow scale = grow scale+grow slow;

}

other

{

grow scale = 1;

}//End else if

if(tipScale & lt; 1)

{

tipSlow = tipSlow * 9.600000 e-00 1;

tipScale = tipScale+tipSlow;

}

Else if (growth)

{

tipScale = 1;

new flower();

}//End else if

The median value of var = (growth scale+tip scale)/2;

Var i = total leaf;

When (I-)

{

Prompt [fNum][i] Rotation (cx, sx, cy, sy);

c2[fNum][i]。 Rotation (cx, sx, cy, sy);

m 1[fNum][i]。 Rotation (cx, sx, cy, sy);

m2[fNum][i]。 Rotation (cx, sx, cy, sy);

c3[fNum][i]。 Rotation (cx, sx, cy, sy);

Prompt [fNum][i] Tip scale;

c2[fNum][i]。 Growth scale;

m 1[fNum][i]。 Scale (intermediate scale);

m2[fNum][i]。 Scale (intermediate scale);

c3[fNum][i]。 Growth scale;

Prompt [fNum][i] Perspective ();

c2[fNum][i]。 Perspective ();

m 1[fNum][i]。 Perspective ();

m2[fNum][i]。 Perspective ();

c3[fNum][i]。 Perspective ();

var tx = tip[fNum][i]。 rx;

var ty = tip[fNum][i]。 ry;

with (flower_mc[fNum][i])

{

clear();

If (flowers)

{

line style(grow scale * leaf length/ 12,mid color[midNum]);

moveTo(fx,fy);

lineTo(fx,fy- 1);

}//End if

lineStyle(growScale * 5,flower? (petal line[petal num]):(leaf line[leaf num]), 10);

moveTo(fx,fy);

BeginGradientFill ("radial", flower? (petal color[petal num]):(leaf color[leaf num]),[ 100, 100],[20,255],{matrixType: "box ",x: - 100,y: fy - h / 2,w: 200,h: h,r:0 });

If (flowers)

{

curveTo(c2[fNum][i]。 rx,c2[fNum][i]。 ry,tx,ty);

curveTo(c3[fNum][i]。 rx,c3[fNum][i]。 ry,fx,fy);

}

other

{

c 1[fNum][i]。 Rotation (cx, sx, cy, sy);

c4[fNum][i]。 Rotation (cx, sx, cy, sy);

c 1[fNum][i]。 Growth scale;

c4[fNum][i]。 Growth scale;

c 1[fNum][i]。 Perspective ();

c4[fNum][i]。 Perspective ();

curveTo(c 1[fNum][i].rx,c 1[fNum][i]。 ry,m 1[fNum][i]。 rx,m 1[fNum][i]。 ry);

curveTo(c2[fNum][i]。 rx,c2[fNum][i]。 ry,tx,ty);

curveTo(c3[fNum][i]。 rx,c3[fNum][i]。 ry,m2[fNum][i]。 rx,m2[fNum][i]。 ry);

curveTo(c4[fNum][i]。 rx,c4[fNum][i]。 ry,fx,fy);

}//End else if

end fill();

var a = 1 - tip[fNum][i]。 z+I;

Exchange depth (a);

_ alpha = a/2+ 100;

}//ends with

}//End time

updateAfterEvent();

}//End of function

Vertex = function (x, y, z)

{

this.x = x

this.y = y

this.z = z

this . rx = this . ry = this . wx = this . wy = 0;

};

Vertex.prototype.perspective = function ()

{

var _ loc 2 = this . wz/400+ 1;

this . rx = this . wx/_ loc 2;

this . ry =(this . wy+flower _ MC[fNum]。 oy)/_ loc 2;

};

vertex . prototype . rotate = function(CX,sx,cy,sy)

{

var _ loc 4 = this . y * cy-this . z * sy;

var _ loc 2 = this . y * sy+this . z * cy;

var _ loc 3 = this . x * CX+_ loc 2 * sx;

_ loc 2 = _ loc 2 * CX-this . x * sx;

this.x = _ loc3

this.y = _ loc4

this.z = _ loc2

};

Vertex.prototype.scale = function (w)

{

this . wx = this . x * w;

this . wy = this . y * w;

this . wz = this . z * w;

};

leafColor = [[2267392,5622784],[7833634, 10079232],[3368482,2280567],[6697728, 15628032],[7803 170, 1337378 1]]。

Leaf line = [30464,6719488,39219,7816,5570611];

petal color =[[ 167 1 1680, 1675 100 1],[ 16750984, 16772829],[ 16763955, 1677765438+]

Petals = [10027008, 16737860, 13399808, 1565858 1, 560563, 7829435];

midColor = [ 16777062, 16763904, 16724787,338 1555,0];

sin = Math.sin

cos = Math.cos

abs = Math.abs

rnd = Math.random

Huadian _mc _ visible = false

grow_btn.onPress = function()

{

init flower();

new flower();

clear interval(flower time out);

flowertime out = setInterval(update flower,8);

click_txt。 _ visible = false

};