Toxiclab.org

Drag and Drop

20.2.2006, 13:58
Submited in: Flash | Total Views: 66566

Learn how to apply Drag and Drop technique on any object. You will also learn how to apply action script code on the object to make it more powerful.










Example:



Step 1

Start Flash.Press Ctrl+J key (Document Properties) and for Frame rate choose 30 fps (Frames per Second). See the picture below.





Step 2


Using the Flash tools for drawing, draw any object. After that, select that object and press F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.

Step 3

Take the Selection Tool (V), and click once on thenew made Movie Clip (object)to select it.Then, open the Action Script Panel (F9) and Paste this script:

on(press) {
startDrag(this,false);
}

on(release) {
stopDrag();
}


on(press) {
startDrag(this,false);
}

on(release) {
stopDrag();
}


Test your movie (Ctrl+Enter).

We're done!

Download example (50 KB)

Are you a website owner?
Click here to register and submit your tutorials!

Browse by category


Most popular tutorials