Implementing Senocular Code

I’m new to as3, and I’m trying to implement two of Senocular’s source codes: duplicateMovieClip, and his transform tool. I have created code that successfully duplicates a MovieClip and enables the duplicated MovieClip to be transformed, but I do not know how to change the properties of the transform tool.

Specifically, I’m trying to move what Senocular calls the “Registration Point” from the point (0,0) of the duped MovieClip to the center of the MovieClip. I believe that I need to use the defaultUV property [SIZE=1]http://www.senocular.com/flash/tutorials/transformtool/doc/com/senocular/display/transform/RegistrationManager.html#defaultUV[/SIZE], but I have no idea how to implement it.

Help would be appreciated. :slight_smile:

Also, just as a side note, I am also trying to make the two Senocular codes compatible with graphics, so any help with that would be great as well.
I am also trying to remove any “tool.select” object by pressing the delete/backspace key, and that might go back to being able to change the properties of the transform tool.

//imports Senocular code
import com.senocular.display.transform.*;
import com.senocular.display.duplicateDisplayObject;

//the two AS linkaged MovieClips that can be clicked on to be duplicated
BoxThing.addEventListener(MouseEvent.MOUSE_DOWN, Clone);
ActualBox.addEventListener(MouseEvent.MOUSE_DOWN, Clone);

//number used to name the duplicate
var circleX:int = 2;

//Creates and Displayes a Cloned MovieClip
function Clone(evt:Event)
{
    //Duplicates the MovieClip as a DisplayObject, and automatically places it in the Display List
    var circle:DisplayObject = duplicateDisplayObject(evt.target as DisplayObject, true);
    
    //Gives each Clone a name, increasing the number by one each time a Clone is created
    circle.name = "circle" + circleX;
    circleX++;
    
    //Moves the named Clone to the coordinates (100,100)
    circle.x=100;
    circle.y=100;
    
    //Outputs the Clone's name
    trace(circle.name);
    
    //Creates an instance of the transform tool DisplayObject and adds it to Display List
    var tool:TransformTool = new TransformTool(new ControlSetStandard());
    addChild(tool);

    //The Transform Tool appears every time the clone is clicked
    circle.addEventListener(MouseEvent.MOUSE_DOWN, tool.select);
    //The Transform tool disappears when the stage behind the clone is clicked 
    stage.addEventListener(MouseEvent.MOUSE_DOWN, tool.deselect);
}