Flash Tutorial: Dragging and Dropping Drop Targets instance tutorial

Source: Internet
Author: User

Flash Tutorial: Dragging and Dropping Drop Targets instance tutorial

Drag and drop targets
The drag-and-drop object involves the... drag-and-drop object. You only need to drag the video clip to edit the object and extend it. With the drag of an object, the position where you discard the object will trigger an event. The position where you drop the object is a video clip, and you will learn how to trigger the event in this tutorial according to the position where the object is dropped.

To help you see what I'm talking about, place a colored paint brush and place it on your computer with the following animation:

When you drag a color paint brush and drop it on the computer, you should have noticed that the computer's color changes to reflect the color of the brush. You will create a tutorial similar to this and learn how to drag and drop objects!

Drag and drop objects:

To speed up the learning process, I have provided some source file interfaces and minor code automatically completed for you. Don't worry, the minor's encoding does not exceed the limit and frame tag. You must add code to make the brush 'drop '. Click here to download some of the source code.
  
Once you have downloaded part of the code, make sure that you have it displayed in the flash. First, we need to add a paint brush for drag-and-drop operations. In fact, I will explain how to add a paint brush as one of the actions. You can add an action to another paint brush.
  
Select a yellow paint brush and a litigation tag. The yellow paint brush can be conveniently named 'yellow '. The instance name is very useful for trying code. Right-click the yellow paint brush and select edit in place. We need a deeper level of video editing. The button you see now will hold the drag-and-drop code.
  
Right-click the yellow video clip in the button and select action. Press Ctrl + E to enter expert mode, copy and paste the following code:

On (press ){
StartDrag ("_ root. yellow ");
}
On (release ){
StopDrag ();
If (_ root. yellow. _ droptarget = "/computer "){
_ Root. computer. gotoandStop ("yellow ");
 }
}

On (press ){
StartDrag ("_ root. yellow ");
}

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.