Using Flash to simulate "Through time and space"

Source: Internet
Author: User
The final effect is as follows:< c13>

<<< Download source files

Flash itself is a two-dimensional animation software, and can not directly make three-dimensional effect, sometimes we need three-dimensional effect to reflect the work, how to do it? can be used in flash some small techniques, coupled with the powerful action action script to simulate a realistic 3D effect, we use this method in flash to simulate a rambling space-time tunnel, deep tunnels have been leading to a distant space-time, giving a very mysterious feeling.
1, first start flash, create a new movie, set the stage size of the movie for 550pixx400pix (in pixels), the background color of the film is dark green, color code for #003300.
2, a new graphic element, named BB, after you enter the editing area of the component, open the Color mixer panel, select the fill type as "radial gradient" in the Fill style Drop-down list, and then set the color of the left and right two sliders, where the color is green, the RGB color code is 0, 204, 153, the right slider color black, set the fill color, select the Ellipse tool, press the "Shift" key in the editing area to draw a positive circle.

3. Create a new movie clip symbol, named B, after entering the editing area of the component, drag the component bb from the library to the edit area, then insert a keyframe in frame 15th, move the ball a little farther to the left, then insert a keyframe at frame 30th, and then move the ball a little farther down to the right. According to the same method, the key frames are inserted in the 45th, 60 and 75 frames respectively, and a distance is moved to different directions, and finally the motion transition animation between the key frames is established, so as to make a small ball to shake back and forth.

4, back to the main scene, the first film to create a background. Open the Color mixer panel, select the fill type as radial gradient in the Fill style Drop-down list, and then set the color of the left and right two sliders, with the left-hand slider color black, the right-hand slider color green, and the RGB color code 0, 135, 8. After setting the fill color, select the Rectangle tool and draw a square in the stage that is slightly larger than the stage size.

5. Insert a layer above the background layer, drag component B to this layer, set its instance name to B0 in the property panel, and finally add the following action to frame 1th:
D = 10;
R = 0;
Pai = 3.14/180;
i = 0;
Do {FLASH 5 also provides a For loop
SetProperty ("/b" + I, _xscale, i);
SetProperty ("/b" + I, _yscale, i);
SetProperty ("/b" + I, _x, D*math.cos (pai*r) +200);
SetProperty ("/b" + I, _y, D*math.sin (pai*r) +200);
Using the most basic algorithm of circle drawing
R = r+10;
D = d+1;
i = i+1;
Duplicatemovieclip ("/b0", "B" +i, i);
Copy B0
while (i<720);
where d is the radius, r is the angle, and the PAI has been converted to radians.
   Action Action Script Description:First initialize the radius d, angle R and loop number I (number of copies of the movie), if the first entry into the loop, the B0 number movie clip will be defined as a location, and then copy the next one in the 1th level relative to B0 movie clip, and named "B1" (pay attention to the expression to use "+" , and the sin and COS functions used in front of it must also be added "Math.", otherwise there will be a mistake); "200" in "Math.Cos (pai*r) +200" is the original position of the center of the circle, 200 this position is closer to the centre, the next cycle is this: the latter one movie Clip always than the previous one big I image point, the name is "B2,b3,b4 ...", the circle radius will gradually increase by 1 each time, such action is made out of the circle is the kind from afar gradually rely on the circular channel.
So far, this is a good effect on the production completed!


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.