Home > Articles > Graphics & Web Design > Dreamweaver & Flash

  • Print
  • + Share This
This chapter is from the book

Summary

Selecting, dragging, and dropping elements is a standard way that computer programs allow users to interact with the environment.

To allow a movie clip to be selected, you must first detect a click on it. You can either place a button inside the movie clip, or use onClipEvent(mouseUp) along with hitTest to determine whether the movie clip has been clicked. You can then send the movie clip to another frame to signify that it has been selected.

To allow for dragging, you can use ActionScript's built-in startDrag and stopDrag commands, or build your own dragging scripts using onClipEvent handlers.

You can use hitTest to determine whether one movie clip overlaps with another. You can then determine the result of a user's dragging. You can use this to allow the user to drag elements onto other elements.

  • + Share This
  • 🔖 Save To Your Account