Jump to content
GreenSock

BryanWoodUrns

Transforming User Uploaded Pictures?

Recommended Posts

Hey everyone,

Sorry if this is too much of a un-researched question that I'm about to ask, but I'm looking in many many places for a solution for what I'm trying to do:

 

I'm trying to develop a "design" studio for products where someone can upload their own pictures and add their own text boxes that are then resizeable and able to be manipulated/rotated etc just like the TransformManager demo demonstrates.

 

How difficult would it be to create a file where the user can select to upload a photo, and once the photo is uploaded, it is automatically able to be manipulated by TransformManager?

 

Thanks for any help/insight that anyone can offer.

 

Would like to get an idea of what is in store before I go ahead and drop the extra $300 for the TransformManager.

Link to comment
Share on other sites

Absolutely. Many people use TransformManager for this type of application. Of course TransformManager doesn't handle the uploading but once you've got a DisplayObject on the stage and want to make it able to be resized/rotated/moved, TransformManager makes that very simple. You could literally do it with one line of code.

 

I don't blame you for wanting to get this question answered before dropping the $299, but keep in mind that there's a 30-day money back guarantee so if you don't like it, you can get a full refund.

 

Let me know if you have any other questions.

Link to comment
Share on other sites

  • 1 month later...

The current iteration of my code is as follows:

 

       var myMC:MovieClip = _root.createEmptyMovieClip("mc"+i, _root.getNextHighestDepth());
       mcVar = "mc"+i;

//this works referencing the clip as _root.mcVar
pictureVar = fileRef.name;
loadMovie("ftp location omitted"+pictureVar, _root.mcVar);
//increment i +1 to load the next picture in a MC
i++;

 

This is currently how i am loading pictures that have already been uploaded by a user. I'm sure you can tell they're being uploaded to a movie clip. Would I have to go about changing the method that I am loading pictures to use the TransformManager?

 

Sorry about my lack of knowledge when it comes to flash, but I normally don't use it very often. This is a large undertaking for me, which is what makes the TransformManager so appealing. (it's less that I have to code myself)

Link to comment
Share on other sites

Ah, you're using AS2. Yeah, as long as all your MovieClips that you want TransformManager to manage share the same _parent, you're fine. It should be as simple as doing myManager.addItem(myMC) after you create your TransformManager instance.

 

Trust me, TransformManager will literally save you hundreds of development hours - it can be rather tricky to build a similar tool on your own. I've heard from seasoned ActionScript developers who have tried and ultimately thrown in the towel because of all the little "gotchas". Not that my code is amazing or anything - I'm just saying that I think you'd save yourself a lot of time and hassle by purchasing TransformManager.

Link to comment
Share on other sites

I'm using AS2 solely because thats what i've found the best examples for what I'm doing online. My copy of flash is actually CS4, so I could definitely be using AS3 instead. Not sure how much of a pain it would be to change from AS2 to AS3 (if i needed to do so to make transformmanager integration easier?) Looking closer at the product page, I notice that it specifically says AS3...

 

Also..

 

This may be answered somewhere on your website, but I've yet to find the answer: What is involved with integrating your code? Is it a process of importing your libraries or how do i actually "add" it to my flash cs4 development program.

 

thanks

Link to comment
Share on other sites

If you don't absolutely need to do it in AS2, I would definitely recommend using AS3 because it is much faster (performance), more powerful, better for debugging, and the debugging tools are far better. AS2 is largely dead, although you can certainly get TransformManager in AS2 if you prefer. http://www.greensock.com/transformmanageras2/

 

As far as integrating it, there is some sample code on the site and in the ASDocs. It's as simple as:

 

import com.greensock.transform.*;

var manager:TransformManager = new TransformManager();
manager.addItem(mc1); //make "mc1" MovieClip transformable.
manager.addItem(mc2); //make "mc2" MovieClip transformable.

 

There are, of course, many options you can set to customize its behavior, but you can literally get things up and running with a single line of code.

Link to comment
Share on other sites

If I were to purchase TransformManager AS3, does it include AS2? Or are they separate from each other?

 

I know I'll get around to updating my code to AS3 (once I learn how to..) But I would like to get around to integrating TransformManager.

 

Thanks for the info.

Link to comment
Share on other sites

The AS2 and AS3 versions are separate - you purchase one or the other.

Link to comment
Share on other sites

Then I have some work to do..

I'll be back sir.. Thanks for all of your help

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

Recently I did an online demotivational poster making tool. It needs some finishing touches and is not online now, but the pic upload works perfectly... If you want I can help you with this part. I use AS3 only so when you purchuse the transform manager AS3 I can give you some of my code and help you with your app...

 

Here is some of my code:

 

private var jagFileRefSave:FileReference = new FileReference();
   	private var loader:Loader = new Loader();
 	private var imagesFilter:FileFilter = new FileFilter("Images", "*.jpg;*.gif;*.png", "*.JPG");

      //in constructur function:
       upload_Image.addEventListener(MouseEvent.CLICK,onClickSave);



	private function onClickSave(e:MouseEvent):void{    
		jagFileRefSave.browse([imagesFilter]);
		jagFileRefSave.addEventListener(Event.SELECT, selectedFile);
	}        

	private function selectedFile(e:Event):void{
		jagFileRefSave.load();
		jagFileRefSave.addEventListener(Event.COMPLETE, loaded);
		jagFileRefSave.addEventListener(ProgressEvent.PROGRESS, onProgress);
	}

	private function onProgress(e:ProgressEvent):void{
		trace( String( Math.ceil( ( e.bytesLoaded/e.bytesTotal)*100)) + " %loaded");
	}

	private function loaded(e:Event):void{
		var rawBytes:ByteArray = jagFileRefSave.data;
		jagFileRefSave.removeEventListener(ProgressEvent.PROGRESS, onProgress);
		loader.contentLoaderInfo.addEventListener(Event.COMPLETE, getBitmapData)
		loader.loadBytes(rawBytes);
	}

	private function getBitmapData(e:Event):void{
		loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, getBitmapData)
		this.image = new Bitmap( (loader.content as Bitmap).bitmapData );

		this.imageAspect = new Aspect(image.width, image.height);

		if(image.width >= image.height ){
			Settings.IMAGE_MODE  = "horizontal";
		} else {
			Settings.IMAGE_MODE = "vertical"
			}

		trace(Settings.IMAGE_MODE + " --> Settings.IMAGE_MODE");

		addChild(image);
		init();
	}

 

If you need help just drop me a PM

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×