Control a Timeline with Mouse Position
Attach MovieClip
Let's get the movieClip on the stage using attach.Movie, which you've done before. First, find your clip in the Library, the right-click and choose Linkage:
- Select Export for ActionScript
- Make the Identifier main (if it isn't already)
- Click OK
Now create the init function:
- Click Statements > User-Defined functions > function
- Create the name init
Now add the attachMovie action to that init function. Remember, this action goes {inside the function braces}:
- Click ActionScript 2.0 Classes > Movie > MovieClip > Methods > attachMovie
- Type _root in the Object box (we want this movieClip to go right on the stage)
- Type the Linkage Name main and Deselect Expression
- Type the New Name main and Deselect Expression
- Set a Depth of 1
Next, we'll use some script to set the x,y position the clip.