The following example creates an ActionScript class which encapsulates all the logic that makes a movie clip draggable. Now whenever a new instance of this class is created, the shape is automatically draggable without having to write additional code for each instance on the Stage.