New Object Handles release

I just whipped up a new ObjectHandles release.  Couple notable things…

They now automatically remove themselves from the SelectionManager when removed from the stage (they add themselves back when added as well).  This fixes a fairly serious memory leak.

I’m deprecating the useage of the Handle class.  It draws the handles through the drawing API.  Now, instead use the ImageHandle class which draws the handles from an embedded image.  There was some wonky logic in there that turned clipping on or off depending on this setting and that was just plain dumb.  Lets just do it one way.  I included sample .png files to simulate the old look.

I fixed some weird flickering when resizing to the left or up.  It only happened on certain cases, and I’m not sure why.  I think it had to do with delayed execution of the Flex layout manager.  Now, I delay the setting of x,y,width, and height and force a validateNow() right after setting those.  Let me know if this causes any problems in your application.

I still don’t have conditional compile for Flex2/Flex3 in there, so this will only compile under Flex 3.  Does anyone know how to get that conditional compiling to detect Flex version without having to pass an extra compiler param?

 

12 Responses to “New Object Handles release”


  1. 1 Tom Van den Eynde

    Hi!

    Great stuff but what happened to the rotation support?
    In the example the handle to rotate is even gone.
    For a lot of applications this is really essential…

    Anyway - keep up the good work!

    Tom

  2. 2 Marc

    Thanks for pointing that out. It’s a feature I don’t use anywhere and I often forget to test it. I’ll take a look into it very soon, for now I’d suggest people who need rotation support to NOT upgrade!

  3. 3 Maxim Porges

    This stuff is awesome. Thanks for sharing it with the rest of us.

    - max

  4. 4 Arul

    Marc!

    Awesome work with ObjectHandles…! Have a couple of points though (you could’ve answered a similar question from someone else earlier)

    I have a button added to ObjectHandles and its just fine as long as its inside an mxml. When the OH and Button components are added in actionscript, the buttons are no longer resizable. They only move alongwith their objecthandles. Any help is much appreciated…

    - Arul

  5. 5 Marc

    Arul,

    Set the percentWidth and percentHeight properties on the button or you could use the top/bottom/left/right styles.

  6. 6 Arul

    Thanks a ton! I set the following and it did the trick… :)
    zoneButton.percentWidth = parent.width;
    zoneButton.percentHeight = parent.height;

    I also noticed that the min width and height of the button depends on the button label text. Is there a way around this pls?

    Thanks again!

  7. 7 slaingod

    Is there a way to use ObjectHandles externally for objects not children of the container? I tried just setting bind variables, but rotation just cause the external image to spin in a circle rather than rotate. Basically, my issue is that I need 2 sets of handles, one for cropping and the other for resizing (cropping occurs by using layer and erase blendmodes for a canvas on top of the image). But it is really tricky to set up, or if you want to have the image continuously clipped. I can’t say I spent a lot of time trying to figure out the issue with the bind variables, but was wondering if you had any ideas. Thanks.

  8. 8 Tom Van den Eynde

    Marc,

    Any chance of supporting the rotation again? Because in that case I’d definitely consider replacing my own “object handles” with yours.

    Thanx,
    Tom

  9. 9 Marc

    Yes, we’ll definitely be supporting it again. I’m just not sure exactly when it’ll get done. I’ve had one person volunteer to fix it, but that’s a few days past-due so I’ll need to check in with him. Otherwise I’ll have to fix it eventually.

  10. 10 Aaron

    Marc,

    I’m not sure what version I’m still using, but I’ve provided support for multi-selection. It’s not production ready, but if anyone is interested, please email me and we can discuss the best way to do it.

    Aaron

  11. 11 Aaron

    Also,

    Does the rotate with resize take into account the different pixel per inch value on the x and y axis??? A co-worker of mine is rotating an object and trying to ensure that a line that is an inch on screen in the horizontal direction is an inch in the vertical direction and all angles in between. Thanks,

    Aaron

  12. 12 Marc

    Multi-selection would rock. Feel free to post a message to the discussion group about it, hopefully someone would pick it up.

    http://groups.google.com/group/objecthandles

    The rotate functionality is very basic. I don’t actually use it anywhere, so that functionality is very raw. Someday I’ll get around to actually fixing it up.

Leave a Reply