You can't create an AVI or a MOV from ActionScript directly the way that you want. AS is designed for display at RunTime. When animation is on your timeline it is baked into the file and the animation can be exported as an AVI stream or a MOV stream which can be used in After Effects.
First, are you using Motion Tweens or Classic Tweens?
Second, you could possibly convert the Movie Clip into a Graphic which has animation inside of it and then have the animation converted to keyframes. Then stretch the length of your movie clip to the appropriate number of frames as a Graphic to play and duplicate this animation by Ctrl or Shift-dragging your keyframes (I don't remember the actual shortcut for this).
The point of the whole thing is that your keyframes need to be baked into the timeline. Not actionscripted.