Demo Effect:
Click here to download the source file
Knowledge Points:
1, frame frame animation production.
2, the use of Attachmovie ();
3, the role of Swapdepths ();
4, the use of statements to achieve the movement of words.
Production process:
First, the production of components.
Create a new Flash document with the default size and any background color. This example uses a total of two movie clips, Xin and Wenzi respectively.
1, the production of Xin Components: (1) Execute the Insert menu under the New Component command, in the name of the input Xin, the behavior of the selected movie clips, OK. Select the Pencil tool in the Tools panel, select Smooth in the options panel below, draw a heart shape in the workspace, about 130*90, fill the fill color with red and black radial, and center it all. As shown in figure
(2) Add a new layer, and then draw a rectangle with a borderless frame, in the Color mixer panel, select a linear fill, add a color standard, three color standard blocks of colors are selected white, and the two ends of the color block of the transparency of 0, the rectangle is deformed after the heart shape, the following figure:
(3) Add a new layer, select the Type tool, set the static text in the property panel, font arbitrary, font size of about 26th, yellow, enter the "Bless Friends", all centered, and copy once, execute the Edit menu under the "Paste to current Position", and then select the pasted text down to the right one pixel, change the text to Gray. As shown in figure:
2, the production of Wenzi components:
(1) In the first layer, select the Rectangle tool, the stroke color white, in the mixer panel, select the Fill color is "#999900", the transparency is 60, draw a 90*90 square, all centered, insert the normal frame in frame seventh.
(2) a new layer. Select the Text tool, the font for the Chinese cloud, the color is "#996600", the font size is 82, input "open" in the work area, all centered, the text will be scattered two times, with "#FFFFCC" color fill. In the 2nd, 3, 4, 5, 6, 7 frames inserted blank key frame, in each frame in turn input: Heart, Discovery, fast, every, one, day. Press the "open" Word action method. Finish the other text production.
3. Right-click the Wenzi component in the library, select the link, and then enter the identifier in the panel: Wenzi, and tick the first frame to export and export for the action script.
Second, the layout of the scene
1, the first layer from the library dragged into the Xin, all centered, and in the property panel for its instance name: HH.
2. Add one layer, insert two keyframes, and enter the following statement in the action panel:
First frame:
num = number of 7;//loaded text
A = 275;//text to do the center of the x-axis of the elliptical motion
b = 200;//text to do the center of the y axis of the oval motion
The radius of the x-axis of the elliptical motion of the RX =190;//text
ry = 50;//Text To do the radius of the Y axis of the oval motion
n = the angle value used by 0;//to calculate the velocity of motion
angle=0;//the Radian value used to calculate the velocity of motion
speed=0;//calculates the speed increment of text response to mouse movement
For (I=1 i<=num; i++) {//Add a component with an identifier named Wenzi from the library to the stage
_root.attachmovie ("Wenzi", "Wenzi" +i, i);
}
Hh.swapdepths (60);//Adjust the depth of HH.
Second frame:
/* Mouse in the left: 50, right: 500, on: 50; Next: 350 of the region, speed assignment (that is, the closer the mouse from the center, this value is smaller, the slower the text movement, the faster the contrary). If the mouse does not have this area, the value of n is automatically added by 1 (that is, when the speed of the text movement is not associated with the mouse position, keep it uniform), and then reset to 1 when n is greater than or equal to 360. */
if (_xmouse>50 && _xmouse<500 && _ymouse>50 && _ymouse<350) {
Speed = (275-_xmouse) *.08;
n + = speed;
} else {
n = (n<360)? N+1:1;
}
For (I=1 i<=num; i++) {
Angle is used to calculate the angle of each text movement and convert it to radians.
Angle = (i*360/num+n) *math.pi/180;
Sets the position of the x and Y coordinates of the text in motion
_root["Wenzi" +i]._x = A-rx*math.cos (angle);
_root["Wenzi" +i]._y = b-ry*math.sin (angle);
Set the amount of zoom in text movement
_root["Wenzi" +i]._xscale = 10-100*math.sin (angle);
_root["Wenzi" +i]._yscale = 100-10*math.sin (angle);
When the y-coordinate of the text is greater than 200, the depth of the interchange text
if (_root["Wenzi" +i]._y>200) {
_root["Wenzi" +i].swapdepths (100+i);
} else {
_root["Wenzi" +i].swapdepths (10-i);
}
Make text stop in different frames to see different text
_root["Wenzi" +i].gotoandstop (i);
}
Third frame:
gotoAndPlay (2);
3, export Test.