Jump to content
Search Community

Separate Transform Controller?

Skwerl test
Moderator Tag

Recommended Posts

hey there, purchased transformmanager and it's really great so far.

 

i have a project to build out that shows a little toolbox with rotate / resize buttons, designed to affect what would be a single non-dynamic movie clip.

i was told by a friend this is possible with transformmanager.

 

so i just need to know how i'd go about moving, resizing, and rotating a movie clip with transformmanager through separate buttons rather than clicking on the movie clip itself. i'd also want to disable the bounding box and anchor points on the movie clip if possible.

 

anyone have any quick code samples?

 

thanks!

Link to comment
Share on other sites

So are there +/- buttons for rotation, scale, and x/y or something? Help me understand the interface and how it's supposed to affect the object. TransformManager solves some rather complex issues related to interactively moving/rotating/scaling DisplayObjects, particularly when there are multiple selections but if you just want buttons that increment rotation, scaleX/scaleY, and x/y position, you could have buttons call functions like:

 

function onClickRotate(event:MouseEvent):void {
   if (event.currentTarget == addRotationButton) {
       mc.rotation += 5;
   } else {
       mc.rotation -= 5;
   }
}

 

And same for x/y values and width/height. I'm not sure that's what you were asking for though.

Link to comment
Share on other sites

ahhh, yeah duh. i guess i can do it the regular old way.

 

the interface is exactly like you said. it's a sort of photo "defacer." i'm using transformmanager to let users scale and rotate clip art (dorky glasses, mustache etc) over a photo, but there's also an interface to zoom/rotate the photo itself. i was going to use transformmanager for it, but i guess i really don't have to.

 

trying to do it with transformitem, i got something like this:

 

var movableItems = new Array(
doodle_3_1,
doodle_3_2,
holder.getChildAt(0)
);

var transformer:TransformManager = new TransformManager({targetObjects:movableItems, constrainScale:true, autoDeselect:true});

var myItem:TransformItem = transformer.getItem(holder.getChildAt(0));
myItem.rotate(10);

the rotate call would have been attached to a button of course.

 

that all basically works... but i think i'll just do it with regular as3 property tweaks.

 

holder is an empty movie clip that gets the underlying jpeg loaded in, hence getChildAt(0).

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.
×
×
  • Create New...