Number of children · flash--other actions for movie clips

Source: Internet
Author: User

One, copy movie clips

1. Method: Duplicatemovieclip (film real name, new real name, depth level)

2. Explanation: The real name of the film is the object you want to copy , the new real name is the object you want to paste , the depth level is the pasted movie clip stacking order (top, bottom, etc.).

3. For example: We first draw a movie clip, its instance name is set to MC, and then draw a button to add an action on the button, the code is as follows.

// When the mouse button is pressed    Duplicatemovieclip ("MC","NWEMC"/// the movie clip named MC is copied into a new movie clip, named Nwemc     this// set new movie clip NWEMC the horizontal axis ofthis    //  Set a new movie clip Nwemc's ordinate is    

Second, delete copy movie clip

1. Method: Removemovieclip (target path or movie depth level)

2. Explanation: Destination Path = location of the movie clip + instance name, depth level as stated above, it is no longer explained.

3. For example: On the basis of the previous piece (copy the movie clip), then draw a button, add the action, the code is as follows.

On (press) {    // Delete movie clip named Nwemc     }

Three, drag command and stop drag command

1. Method: StartDrag (Target,lock,left,top,right,bottom) and Stopdrag () (it does not have any parameters)

2. Explanation: Target is the destination path of the movie clip to be dragged, and lock is the location where the movie clip is selected to be locked in the center of the mouse or locked in the mouse click (The lock is a Boolean value),

There are left, top, right, and bottom these, which are the meanings of their English words (upper and lower bottom), which are used to specify the range of drag.

3. For example: Draw a movie clip and add an action to the movie clip with the following code.

// When the left mouse button is pressed    StartDrag (Thisfalse// start dragging  / / when the left mouse button is lifted    / / stop dragging }

Four, the target path command

1. Method: TargetPath (Movieclipobject)

2. Explanation: Movieclipobject is a reference to the movie clip to get the target path (for example, _root or _parent).

3. For example: This command to match the other commands have practical significance, so do not write a case here, next to the appropriate place to speak.

Number of children · flash--other actions for movie clips

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.