So I have found a great class to cover all aspects this.
Download from here.
http://blog.greensock.com/transformmanageras2/
Easy to use. Even I can do it..
Just put the gs folder in the directory of the final swf file.
Code:
import gs.TransformManager;
var manager_obj = new TransformManager({targetObjects:[outline_mc], bounds:{xMin:0, xMax:600, yMin:0, yMax:600}, forceSelectionToFront:true, eventHandler:onAnyEvent});
manager_obj.addEventListener("move", onMove);
_root.manager_obj.constrainScale = outline_mc;
_root.manager_obj.lockRotation = outline_mc;
function onAnyEvent(event_obj:Object):Void {
trace("Action: "+event_obj.action+", MovieClip or TextField: "+event_obj.targetObject+", transformed?: "+event_obj.transformed);
}
function onMove(event_obj:Object):Void {
trace("Moved mc: "+event_obj.targetObject);
}
myData = new LoadVars()
myData.load("imagecode.txt")
myData.onLoad = function(succes){
if(succes){
holder_mc.loadMovie(this.Image)
} else trace("Error loading data")
}
cropBtn.onPress = function () {
var x_axis = outline_mc._x ;
var y_axis = outline_mc._y ;
//Being a circle this is enough to get both h and w.
realwidth = outline_mc._height;
//to get x and y of top left corner of square around the circle
true_x = x_axis - (realwidth/2);
true_y = y_axis - (realwidth/2);
getURL ("cropper/tests/data3.php", "_self", "POST");
}
my outline_mc is just a circle about 400 px with a border of 3 pixels. Fill is Alpha 5. Registration point in the center. holder_mc is an empty movie clip position at the top left of the movie.
Only thing to add is a preloader for the image.
Jeremy thanks for your help.
Anyone else please enjoy this script!