Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 3.50 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-09-2008, 11:38 PM   PM User | #16
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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.
gnomeontherun is offline   Reply With Quote
Old 06-12-2008, 12:42 PM   PM User | #17
beedie
New Coder

 
Join Date: Mar 2008
Posts: 88
Thanks: 12
Thanked 0 Times in 0 Posts
beedie has a little shameless behaviour in the past
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!
beedie is offline   Reply With Quote
Old 03-31-2009, 04:36 PM   PM User | #18
rountrjf
New to the CF scene

 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rountrjf is an unknown quantity at this point
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?
rountrjf is offline   Reply With Quote
Old 04-01-2009, 09:07 AM   PM User | #19
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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.
gnomeontherun is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:55 AM.


Advertisement
Log in to turn off these ads.