Check it: radarLocation function! (AS3)

hey everyone, you ever wanted to make a radar for a game or for some other reason, the math can be tricky to get it right, but now you don’t need to worry about the math, check out this neat little radar tracking function!

//BY:Donovan Hubbard 2008, actionscript 3
//mark=your radar blip, lilArea=your radar bounds, bigArea=your stage area
//lilArea, and bigArea should have 0,0 registration points
function radarLocation(mark:MovieClip, lilArea:MovieClip, bigArea:MovieClip) {
    var xDiff:Number = bigArea.width / lilArea.width;
    var yDiff:Number = bigArea.height / lilArea.height;
    var markX:Number = ((lilArea.x) + ((Math.abs(bigArea.x))/xDiff));
    var markY:Number = ((lilArea.y) + ((Math.abs(bigArea.y))/yDiff));
    mark.x = markX;
    mark.y = markY;
}

happy coding all :mountie: