My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 08, 2009 by marc.hughes
Labels: Featured
ObjectHandlesUsage  
Here are some projects that use ObjectHandles, feel free to send in more.

Introduction

Here are some projects that use ObjectHandles, feel free to send in more.

Projects

  • A Digital Book - Much of the interface of A Digital Book utilizes Object Handles.

Here's a video of an example using ObjectHandles in some non-standard ways. It's:

  1. Has a moving / resizing event handler to show a custom tooltip
  2. Has custom resize handle images that look like grey horizontal bars
  3. Only allows vertical resizing.
  4. On a MOVED event, the objects have an animation that snaps them to a grid


Comment by jay.machine, Feb 17, 2008

good~

Comment by zhengyub, Jul 15, 2008

thanks,very usefull for me!

Comment by shekhargood, Jul 22, 2008

thanks and it is very use full. and i need one help on this that while adding a text area in the object handle control i am not able to write in that textarea can i access that with objecthandle resize and move.

Comment by gabriela...@hotmail.com, Sep 01, 2008

Hi. Ill be using ObjectHandles? on an educational software (educational object editor). It is going to very usefull, thanx a lot!

Comment by inshua, Oct 04, 2008

great!

Comment by inshua, Oct 04, 2008
Comment by shekhargood, Jul 22, 2008

thanks and it is very use full. and i need one help on this that while adding a text area in the object handle control i am not able to write in that textarea can i access that with objecthandle resize and move.


i meet the same probleam.

Comment by kanukukreja, Oct 13, 2008

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" >

<mx:Script>

<![CDATA[
//import mx.controls.Image;
import flash.text.TextField?;

import com.roguedevelopment.objecthandles.; Embed(source='assets/rotate.png')?
Bindable?
public var rotateHandle:Class;
private function init() : void
{
var oh:ObjectHandles? = new ObjectHandles?(); oh.height = 50; oh.width = 50; / var image:Image = new Image();
image.source = "assets/Texture_Slices?.png"; image.percentHeight = 100; image.percentWidth = 100; image.maintainAspectRatio = true;
oh.addChild(image);
var squareSize:uint = 50; var square:Shape = new Shape();
square.graphics.beginFill(0xFF0000, 0.5); square.graphics.drawRect(0, 0, squareSize, squareSize); square.graphics.beginFill(0x00FF00, 0.5); square.graphics.drawRect(200, 0, squareSize, squareSize); square.graphics.beginFill(0x0000FF, 0.5); square.graphics.drawRect(400, 0, squareSize, squareSize); square.graphics.endFill();
oh.addChild(square); /
var tf:TextField? = new TextField?();
tf.text = "Hello Hello";
oh.addChild(tf);
oh.allowRotate = true;
this.addChild(oh); // replace genericExamples with a canvas in your application
}
]]>
</mx:Script>

</mx:Application>

I tried with text, images and shapes, but its working fine only with images for rest its throwing error.

Comment by cshreffler, Nov 12, 2008

I have a need to scale a text control within the component so that the text dynamically scales as the user drags the boundaries of the ObjectHandle? component. Does anyone have an example of how to do this?

Comment by RyanSun81, Dec 22, 2008

to kanukukreja You can try Lable instead of TextField? and it works. The only problem is that it's only resizing the oh container itself, not the text .... :(

Comment by iacob.campia, Jan 23, 2009

i need the exact same thing cshreffler needs. how can i do that with a text ?

Comment by iacob.campia, Jan 23, 2009

i found the way to do that:

<Script>

var originalWidth : int, originalHeight : int;

function init() : void
{
    // save original width and height which match scale 1
    originalWidth = this.hnd.width;
    originalHeight = this.hnd.height;
}

function onResize(event : ObjectHandleEvent) : void 
{
   // rescale width and height based on the new size
   this.label.scaleX = (this.hnd.width * 100 / this.originalWidth) / 100;
   this.label.scaleY = (this.hnd.height * 100 / this.originalHeight) / 100;
}

</Script>

<ObjectHandles id="hnd" objectResizingEvent="onResize(event)" ....
   <Label id="label" text="asdasd" .....
</ObjectHandles>
Comment by ja...@wilkesdesign.com, Feb 22, 2009

Fixed aspect ratio bug fixed

Hi and thanks for this great component.

I've made a quick mod the ObjectHandles?.as file to correct the behaivour of the left hand handles when fixed aspect ratio is sellected.

			if( (wasResized && alwaysMaintainAspectRatio ) ||
				(wasResized && ( isCorner && cornerMaintainAspectRatio) ) )
			{	
				desiredSize.x = aspectRatio * desiredSize.y;
				if (isResizingLeft && isResizingUp)
				{
					desiredPos.x = originalPosition.x + (originalSize.x - desiredSize.x);
					desiredPos.y = originalPosition.y + (originalSize.y - desiredSize.y);
				}
				if (isResizingLeft && isResizingDown)
					desiredPos.x = originalPosition.x + (originalSize.x - desiredSize.x);
						
			}

Hope this help

Cheers James

Comment by pwhite20, May 31, 2009

First of all...Great Component!

I'm trying to use the "alwaysMaintainAspectRatio" attribute, but get different results based upon when it is enabled in the tag. For example:

1) If I initialize the tag with alwaysMaintainAspectRatio="true" and allowRotate="true", only the four corner handles show up and I don't get a rotate handle to rotate my text.

<oh:ObjectHandles 
    id="oh1"
    resizeHandleImage="{resize_handle}" 
    rotateHandleImage="{rotate_handle}" 
    allowRotate="true" 
    alwaysMaintainAspectRatio="true" 
    objectResizingEvent="onResize(event)" > 

    <mx:Text id="txt1" text="Graphical Handles" /> 

</oh:ObjectHandles>

2) Now, if I initiate the tag this time with alwaysMaintainAspectRation="false" and allowRotatate="true", I will now get all eight resizing handles and my rotation handle. I can then perform some sort of action (like a button click) to reset alwaysMaintainAspectRation="true", and all eight of my resizing handles will remain, as well as my rotation handle.

<mx:Button label="Maintain Aspect Ratio" click="oh1.alwaysMaintainAspectRatio=true" x="10" y="100"/>

<oh:ObjectHandles 
    id="oh1"
    resizeHandleImage="{resize_handle}" 
    rotateHandleImage="{rotate_handle}" 
    allowRotate="true" 
    alwaysMaintainAspectRatio="false" 
    objectResizingEvent="onResize(event)" > 

    <mx:Text id="txt1" text="Graphical Handles" /> 

</oh:ObjectHandles>

It seems to display in two different ways depending on how it is initialized. What I would like to do is initialize it with alwaysMaintainAspectRatio="true", but still keep all eight drag handles and the rotation button so the user can taggle the alwaysMaintainAspectRation on and off. Does anybody have any ideas how I might be able to accomplish this?


Sign in to add a comment
Hosted by Google Code