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 ");
}