I might have spotted another use of ObjectHandles over at the AsButtonGen webpage. Over on the text and image tabs you can add stuff to your button that can be resized/moved using some familiar looking handles and mouse cursors. Also, I recognize a bug with resizing the left bottom corner that was in previous versions of the library.
If it is ObjectHandles, this would be the second time I just ran into a use of them, that’s pretty cool. Unfortunately, I couldn’t find an email address on that site.
But that aside, the site is neat. It lets you create some pretty "web 2.0" style buttons with stripes, highlights, etc.
I spent some time on the library yesterday. I was tyring to get the rotation+resizing thing working better since it’s been somewhat broken for a while. I’ve never needed that feature so it’s been neglected. Unfortunately, I’m running into a bit of a brick wall. I’m still trying to figure out exactly what it should do, nevermind how. Luckily, most of my Trigonometry from High School is coming back to me since it’s heavy in that department.
As mentioned in a previous post, I’m giving a talk to the BFAIG group on creating a simple diagramming application in Flex using ObjectHandles and Degrafa. It’s been delayed until tonight at 7:00pm EST. If you’re interested in seeing it, this is a joint in-person and online meeting. I’m actually attending from a remote location, so the online experience should be pretty good. You can get info about how to attend online at the BFAIG Blog post.
Tonight, I’ll be giving a short talk to BFAIG on using ObjectHandles and Degrafa to make a simple diagramming application. This application demonstrates the basics of working with Degrafa, and also shows how easy it is to make an interface that allows users to resize and move objects on screen.
The example application has source attached, and is licensed under the MIT license. I hope someone can take it and make some really great application out of it. Please drop me an email if you do!
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?
New version is up. It fixes the selectNone() bug, has the correct metadata for events, and no longer creates event listeners on the parent object for every single OH you instantiate. I also added an updateAfterEvent call when things are getting moved, it really made the motion a lot smoother, never thought it would matter much.
[ObjectHandles is a library to easily manage user movable and resizeable onscreen objects]
It’s been a while, as I’ve been overly busy lately, but there is now a new ObjectHandles release. This release fixed one bug with non-visible components, and added a new set of mouse cursors as the default. Since my last build, there’s a been a bunch of submissions for new mouse cursors. I thank you all! In the near future I’ll create a separate swc with them all embedded so developers can pick and choose. But for now I’ve embedded one of those new options into the library as the default. You can download the new release at
Now, you can also set your own mouse cursors, outside of the library. To do this, implement the OHMouseCursors interface, instantiate your class, and assign it to the ObjectHandles.mouseCursors property. A sample cursor class follows:
package your.package { public class YourMouseCursorClass implements OHMouseCursors { [Embed("../../../assets
/cursors/set1/resize- v.png")] protected var sizeNS:Class; [Embed("../../../assets/cursors/set2/move.png")] protected var sizeAll:Class; [Embed("../../../assets/cursors/set1/resize- l.png")] protected var sizeNESW:Class; [Embed("../../../assets/cursors/set1/resize-r.png")] protected var sizeNWSE:Class; [Embed("../../../assets/cursors/set1/resize- h.png")] protected var sizeWE:Class;
protected var map:Object = new Object();
public function getCursor(name:String) : MouseCursorDetails { return map[name]; }
public function YourMouseCursorClass () : void { // Numbers are offsets to the hot-spot of the cursor (the point of the arrow, the middle of the resize bar, etc.) map["SizeNS"] = new MouseCursorDetails(sizeNS, -5, -8 ); map["SizeAll"] = new MouseCursorDetails(sizeAll, -11, -13 ); map["SizeNWSE"] = new MouseCursorDetails(sizeNESW, -5, -6 ); map["SizeNESW"] = new MouseCursorDetails(sizeNWSE, -5, -6 ); map["SizeWE"] = new MouseCursorDetails(sizeWE, -9, -6 ); } } }
I’ve moved the download location of Object Handles to take advantage of the download functionality of Google Code. This should let me manage versions much easier.