Using the Senocular AS3 TransformTool in Flex

Hey,I am so interested about that you had ever used the ‘TransformTool’ library in your Flex project. But there is little examples showing how to use it in flex, Would you please share some example about how to use ‘TransformTool’ in Flex? I have tried as such a way:

but it failed at line
canvas.addChild(defaultTool);
Can you give any hints? Thanks.

Like most pure AS3 display classes, the TransformTool needs to be added to a UIComponent wrapper to function properly in Flex.

Source.

8 Responses to “Using the Senocular AS3 TransformTool in Flex”


  1. 1 Blaight

    It is so great. Thanks a lot.
    Expects example with detailed source code.

  2. 2 Blaight

    You are so nice. The source code is availiable now. Thank you very much.

    But I have a little problem. Do I have to add the TransformTool to the top level container such as Application in your example? Based on your example, if I use
    hbox.addChild( component);
    then something strange happends. It seems that the TransformTool is ‘under’ the image and can not response to moving action the rotation point can not be seen yet.

  3. 3 Joel

    I add the TransformTool to the top level container.

  4. 4 ynk

    when u rotate then scale, the scale doesnt follow properly the cursor because of the difference between mouse coordinates which are always with a ‘virtual’ rotation=0 and the angle of the object.

    i had the same bug while doing my class. I used this :

    var rotationRad:Number = rotation * Math.PI / 180;
    var px:Number = XY.x * Math.cos(rotationRad) - XY.y * Math.sin(rotationRad);
    var py:Number = XY.x * Math.sin(rotationRad) + XY.y * Math.cos(rotationRad);

    hope it’ll work

  5. 5 Marc

    I think there is one line missing in the function scaleTopRightInteraction. Add below
    _toolMatrix.ty += oldBounds.subtract(boundsBottomLeft).y;
    the line:
    _toolMatrix.tx += oldBounds.subtract(boundsBottomLeft).x;

    Otherwise, scaling of a rotated target does not work properly.

    There is also the issue with resizing the browser. The controls and the target move apart as soon as the browser window is resized.

  6. 6 rui

    I don like it, it just implements matrix, in some cases this is great, but if I’m applying to an container, I don want scale the container (just width/height), imagine that I have a frame border on that picture, then the border will stretch too.. i had senocular full implemented on adigitalbook.com, then i had to remove :(

  7. 7 Joel

    @rui

    That was ultimately why I stopped using this tool and went with ObjectHandles instead.

  8. 8 kanu kukreja

    I want to add delete control on top right, i tried alot and added 2 neew classes as well “TransformToolDeleteControl.as” & “TransformToolDeleteCursor.as”, but that control is not getting visible anyhow.
    And one more thing if i move rotation control in to center then it stops working.
    Can anybody please share their ideas with me.

  1. 1 Image editing component in Flex « I don’t like computers.

Leave a Reply