I'm not going to tell you exactly because I think you'd learn better if I told you how to do it rather than giving you how to do it. First, you are going to want the origin (home) of the sprite to be where you want it to swing (8,16 is generally good for a sword). Then you need to move the sword to the location where the character would be holding it (hand). Then animate the sword to rotate.