Flash script Programming--dna double helix structure

Source: Internet
Author: User
Tags copy insert
Programming | scripts

Click here to download the source file

1. Open Flash, create a movie clip of the shape shown in the figure, and name the movie clip instance "Dna1" in the instance panel

2, create a new layer, we will insert action script on this layer.

3, our idea is to copy this movie clip, and after each copy do a small transfer, and then change again and again.

4. Insert the following action script on the first keyframe:
for (i=2; i<30; i=i+1)

{

Duplicatemovieclip ("/dna1", "DNA" Add (i), i);

SetProperty ("/dna" Add I, _rotation, GetProperty ("/dna")
Add (i-1), _rotation) +11);

SetProperty ("/dna" Add I, _x, GetProperty ("/dna")
Add (i-1), _x) +10);

}

SetProperty ("/dna1", _visible, "0");

5. On the second keyframe, insert the following action:

for (i=2 i < i = i+1)

{SetProperty ("/dna" Add I, _rotation, GetProperty ("/dna")
Add I, _rotation) + 5);

}

6. On the third keyframe, insert the following action:

gotoAndPlay (2);

7, debug the film, you can get the effect of the above see.



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.