I think Carlytoon posted an excellent piece of code, but if you want to stay away from code, you could use timeline tweens, or as master565 suggested motion guides (which is essentially an elaborate timeline tween). Since it's my suggestion, I'll try and explain the tweening approach.
Basically, you'll want a nested structure, meaning you have movieclips inside movieclips. Add the sun movieclip, and inside it place the earth movieclip. The pivot point of the earth movieclip should be centered on the sun, but the actual movieclip itself should be at the right orbit, ofcourse.
This way, you can rotate it around the sun. So, make a new keyframe at -say- frame 30, and rotate the earth 360 degrees. Next you right-click the frames in between the keyframes, and add a classic tween. If you scroll back and forth, you should see the earth rotating around the sun!
(By the way, if you want to avoid having a duplicate frame, which makes it seem like the animation pauses for a little while, right-click on the frame before the second keyframe, and add a keyframe there. Then remove the last keyframe, so that when the animation is at it's end and goes back to the beginning it doesn't show two frames with the earth at the same rotation)
Doing the moon is essentially the same, only inside the earth movieclip. Just add it, move the pivot point to the center of the earth, rotate, add keyframes and a tween.
Note that this does not include any realistic rotations of earth or the moon, if you want it very realistic I'd really recommend using code since it gives you a lot more control ;)