• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Hour 16. Using ActionScript for Advanced... > Making Drag-and-Drop Interactions

Making Drag-and-Drop Interactions

One of the most effective ways to give your users the power to interact is by letting them drag items around the Stage. This is essential for the creation of most games, and it's also a particularly effective teaching method because some people are “tactile” learners (whereas others might be visual or aural learners). For whatever reason, you might want to let your users move items around the Stage. This is simple to do in Flash.

There's a slight dilemma, however. In Flash, the simplest way to determine when a user clicks a specific area involves the use of buttons. However, movie clip instances give you a few additional capabilities. The good news is that you can make movie clips respond to events originally designed for buttons (such as press and release). The bottom line is that buttons and movie clips can behave like each other; ultimately however, movie clips can do more than buttons. The time to use a button is primarily when you want different effects for the up, over, and down states. In any event, in this hour you'll use movie clips whenever you can—including for the draggable object task that follows.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint