Hi guys. I'm trying to make a simple snooker/pool type game in Javascript using Director. At the moment i have created the images of a cue (sprite1) and a ball (sprite2). I have set the cue to rotate 360 degrees around the ball using the mouse as an aim. When the mouse is clicked, the cue is locked in place and the aim is for the player line up the cue and the ball up with a pocket and hit it into it. I have got as far as getting the cue locked in place and have wrote code for the ball the react upon the press of the space bar key. Here is my code:

Code:
function exitframe(me) {


_global.angle1 = Math.atan((_mouse.mouseV-sprite("cue").locV  )/(_mouse.mouseH-sprite("cue").locH  ))

if (_mouse.mouseH < sprite("cue").locH) {
  sprite("cue").rotation = _global.angle1*180/Math.PI -90
}
else {
  sprite("cue").rotation = _global.angle1*180/Math.PI +90
}

}
function beginsprite(me) {
cuelock = 0
}


function exitframe(me) {

if (cuelock == 0) {
_global.angle1 = Math.atan((_mouse.mouseV-sprite("cue").locV  )/(_mouse.mouseH-sprite("cue").locH  ))
if (_mouse.mouseH < sprite("cue").locH) {
  sprite("cue").rotation = _global.angle1*180/Math.PI -90
}
else {
  sprite("cue").rotation = _global.angle1*180/Math.PI +90
}
}
if ((cuelock == 1) && (_key.keyPressed(49))) {
  put("key")
  sprite(2).loch = 200


  
}
}

function mouseup(me) {
cuelock = 1
}


function rightmouseup(me) {
cuelock = 0
}
Does anybody know how I can get the ball to travel x amount of distance (say 100px) along the angle of the cue?

Kindest Regards,

Tom