In this tutorial, I'm going to show you how to program the tank rifle so that it changes its rotation according to where your mouse is. It's good to know the little piece of code that makes the effect possible since it comes in really handy in many kinds of Flash applications, mostly in games, but not only. For instance, I saw an example of this code "in action" on one Flash website on which there was an object that kept turning towards my mouse. Anyway, to achieve this effect, I'm not going to need to use Sine or Cosine. Rather, I'm going to go a much simplier way using atan2 function. To evaluate an angle using this function, you only need to provide Flash with y and x coordinates. After that, Flash will compute and return the angle, measured in radians. Our job then will be only to convert these radians to degrees. Alright, why not have a look at how the atan2 function looks before we start?