Mouse drag frame rotate

I have a 40 frame animation that in sequence rotates an image. That I need to add a mouse drag function so I can scrub through the images like here

http://www.yofla.com/flash/3d-rotate/examples.php?exampleId=6

Can anyone help?