The command to start dragging an element can be found by expanding Actions->Movie Clip Control; the fifth option down is the startDrag command, which causes the dragging action to start (hence the name "startDrag"). Double-clicking on this will insert the following code:
startDrag ( ) ;
Like other Flash commands, the parentheses are where you would put any sub-parameters for the command to define its behavior. We don't need to do that for this; we're just doing a simple drag and drop. All we need to do is define what the drag command will affect, and for that we're going to actually type in an addition to the code:
this.startDrag ( ) ;
If you remember from past lessons, this sort of structure places the object to be affected before the command, separated by a period. The this parameter is a common parameter used to refer to the object that you're assigning an action to; in essence, at the moment you are "inside" the Hat object, and so by referring the startDrag command to this you are telling it to act on the object that it is inside of. This can work with nearly any object.


