Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    You could probably write something that would change the scale of the drawing_mc, but then you would need to determine the hit location to be on the edge of the circle so it doesn't get mixed up with the dragging functions.

  2. #17
    New Coder
    Join Date
    Mar 2008
    Posts
    88
    Thanks
    12
    Thanked 0 Times in 0 Posts
    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!

  3. #18
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm wanting to make an image clickable on my webpage editor I'm making and it then loads the image inside of the "TransformManager" and from there the user has a javascript dialog window with other photos available... then when they click on those photos it would add them to the TransformManager.

    At the end it takes the final "image" of everything all together and crops it out and sends the "image" to the server as the fixed dimensions image that goes into the webpage predefined box.

    Also I would like them to be able to drag the images beyond the border of the flash file(not necessarily keep them visible) just let them drag it anywhere.

    Is this a possibility?

  4. #19
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Do you have a link or code?

    I don't know of any way to have an image drag from inside of flash seemlessly outside. It would require some really fancy javascript.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.


 
Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •