[flexcoders] Re: Creating Resize Handles

2009-09-20 Thread flexaustin
I should have done a debug and walked in through, but my issue has to do 
something with the creation of the tool and when its created in the "marks" 
layer of Flare. 

I had to do the following:

 tool = new TransformTool();
tool.moveEnabled = false;
tool.skewEnabled = false;
tool.registrationEnabled = false;
tool.constrainScale = true;
tool.maxScaleX = 2;
tool.maxScaleY = 2;
  
//tool.scaleWithRegistration = scale_registration.selected;
_vis.marks.addChild(tool);
tool.x = _targ.x;
tool.y = _targ.y;

tool.target = _targ;

My issue before was I was assigning the target of the tool then doing addChild. 
 Which even though I had a reference to targ to pass in I guess it makes sense 
that the tool needs to be added the marks layer before assigning a target so as 
to understand its boundaries and what not.

So problem solved. Thanks for your help, though.

J


--- In flexcoders@yahoogroups.com, "ag_rcuren"  wrote:
>
> I sounds like you might be having issues with where you added the 
> TransformTool as a child. Try adding the TransformTool as a child of the 
> application and see if that helps. If you are still having problems you could 
> email me or post your code and then I could take look at it.
> 
> Here is an example of how I used it this tool before. All of this code was 
> right in a script tag on the main mxml file.
> 
> private var transformTool:TransformTool;
> 
> private function imageClickHandler(event:MouseEvent):void
> if (!transformTool)
> {
> transformTool = new TransformTool();
> addChild(transformTool);
> }
> transformTool.target = event.currentTarget as DisplayObject;
> }
> 
> 
> --- In flexcoders@yahoogroups.com, "flexaustin"  wrote:
> >
> > Robert, have you used the transformtool in a flex app before? When I try to 
> > add it via tool.target = mySprite and myOtherSprite.addChild(tool). 
> > 
> > It puts the tool on screen but its so small I can barely see it. If I try 
> > to set the w or h it stays the same size; tiny. Also when the tool is put 
> > on screen its about 200 pixels away on the x-axis.
> > 
> > Jason
> > 
> > 
> > 
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "ag_rcuren"  wrote:
> > >
> > > ObjectHandles is ok but they do not handle rotation very well. Have a 
> > > look at this
> > > 
> > > http://www.sephiroth.it/weblog/archives/2007/07/transformtool_modification.php
> > > 
> > > --- In flexcoders@yahoogroups.com, Fotis Chatzinikos  
> > > wrote:
> > > >
> > > > Google ObjectHandles ;-)
> > > > 
> > > > On Thu, Sep 17, 2009 at 5:06 PM, flexaustin  wrote:
> > > > 
> > > > >
> > > > >
> > > > > Anyone ever create or see a tut/example on how to create resize/skew
> > > > > handles on Sprites or UIComponents?
> > > > >
> > > > > Say you click a Sprite on screen, the sprite would should show a 
> > > > > bounding
> > > > > box, similar to Flash, Photoshop, Visio or Firefox, which allow you 
> > > > > to make
> > > > > the clicked Sprite wider, thinner, skew, or rotate the Sprite.
> > > > >
> > > > > TIA, J
> > > > >
> > > > >  
> > > > >
> > > > 
> > > > 
> > > > 
> > > > -- 
> > > > Fotis Chatzinikos, Ph.D.
> > > > Founder,
> > > > Phinnovation
> > > > Fotis.Chatzinikos@,
> > > >
> > >
> >
>




[flexcoders] Re: Creating Resize Handles

2009-09-20 Thread ag_rcuren
I sounds like you might be having issues with where you added the TransformTool 
as a child. Try adding the TransformTool as a child of the application and see 
if that helps. If you are still having problems you could email me or post your 
code and then I could take look at it.

Here is an example of how I used it this tool before. All of this code was 
right in a script tag on the main mxml file.

private var transformTool:TransformTool;

private function imageClickHandler(event:MouseEvent):void
if (!transformTool)
{
transformTool = new TransformTool();
addChild(transformTool);
}
transformTool.target = event.currentTarget as DisplayObject;
}


--- In flexcoders@yahoogroups.com, "flexaustin"  wrote:
>
> Robert, have you used the transformtool in a flex app before? When I try to 
> add it via tool.target = mySprite and myOtherSprite.addChild(tool). 
> 
> It puts the tool on screen but its so small I can barely see it. If I try to 
> set the w or h it stays the same size; tiny. Also when the tool is put on 
> screen its about 200 pixels away on the x-axis.
> 
> Jason
> 
> 
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "ag_rcuren"  wrote:
> >
> > ObjectHandles is ok but they do not handle rotation very well. Have a look 
> > at this
> > 
> > http://www.sephiroth.it/weblog/archives/2007/07/transformtool_modification.php
> > 
> > --- In flexcoders@yahoogroups.com, Fotis Chatzinikos  
> > wrote:
> > >
> > > Google ObjectHandles ;-)
> > > 
> > > On Thu, Sep 17, 2009 at 5:06 PM, flexaustin  wrote:
> > > 
> > > >
> > > >
> > > > Anyone ever create or see a tut/example on how to create resize/skew
> > > > handles on Sprites or UIComponents?
> > > >
> > > > Say you click a Sprite on screen, the sprite would should show a 
> > > > bounding
> > > > box, similar to Flash, Photoshop, Visio or Firefox, which allow you to 
> > > > make
> > > > the clicked Sprite wider, thinner, skew, or rotate the Sprite.
> > > >
> > > > TIA, J
> > > >
> > > >  
> > > >
> > > 
> > > 
> > > 
> > > -- 
> > > Fotis Chatzinikos, Ph.D.
> > > Founder,
> > > Phinnovation
> > > Fotis.Chatzinikos@,
> > >
> >
>




[flexcoders] Re: Creating Resize Handles

2009-09-18 Thread flexaustin
Robert, have you used the transformtool in a flex app before? When I try to add 
it via tool.target = mySprite and myOtherSprite.addChild(tool). 

It puts the tool on screen but its so small I can barely see it. If I try to 
set the w or h it stays the same size; tiny. Also when the tool is put on 
screen its about 200 pixels away on the x-axis.

Jason





--- In flexcoders@yahoogroups.com, "ag_rcuren"  wrote:
>
> ObjectHandles is ok but they do not handle rotation very well. Have a look at 
> this
> 
> http://www.sephiroth.it/weblog/archives/2007/07/transformtool_modification.php
> 
> --- In flexcoders@yahoogroups.com, Fotis Chatzinikos  
> wrote:
> >
> > Google ObjectHandles ;-)
> > 
> > On Thu, Sep 17, 2009 at 5:06 PM, flexaustin  wrote:
> > 
> > >
> > >
> > > Anyone ever create or see a tut/example on how to create resize/skew
> > > handles on Sprites or UIComponents?
> > >
> > > Say you click a Sprite on screen, the sprite would should show a bounding
> > > box, similar to Flash, Photoshop, Visio or Firefox, which allow you to 
> > > make
> > > the clicked Sprite wider, thinner, skew, or rotate the Sprite.
> > >
> > > TIA, J
> > >
> > >  
> > >
> > 
> > 
> > 
> > -- 
> > Fotis Chatzinikos, Ph.D.
> > Founder,
> > Phinnovation
> > Fotis.Chatzinikos@,
> >
>




[flexcoders] Re: Creating Resize Handles

2009-09-17 Thread flexaustin
This one is much better! I don't have to throw my objects in it like the other 
one.

THanks.  

--- In flexcoders@yahoogroups.com, "ag_rcuren"  wrote:
>
> ObjectHandles is ok but they do not handle rotation very well. Have a look at 
> this
> 
> http://www.sephiroth.it/weblog/archives/2007/07/transformtool_modification.php
> 
> --- In flexcoders@yahoogroups.com, Fotis Chatzinikos  
> wrote:
> >
> > Google ObjectHandles ;-)
> > 
> > On Thu, Sep 17, 2009 at 5:06 PM, flexaustin  wrote:
> > 
> > >
> > >
> > > Anyone ever create or see a tut/example on how to create resize/skew
> > > handles on Sprites or UIComponents?
> > >
> > > Say you click a Sprite on screen, the sprite would should show a bounding
> > > box, similar to Flash, Photoshop, Visio or Firefox, which allow you to 
> > > make
> > > the clicked Sprite wider, thinner, skew, or rotate the Sprite.
> > >
> > > TIA, J
> > >
> > >  
> > >
> > 
> > 
> > 
> > -- 
> > Fotis Chatzinikos, Ph.D.
> > Founder,
> > Phinnovation
> > Fotis.Chatzinikos@,
> >
>




[flexcoders] Re: Creating Resize Handles

2009-09-17 Thread ag_rcuren
ObjectHandles is ok but they do not handle rotation very well. Have a look at 
this

http://www.sephiroth.it/weblog/archives/2007/07/transformtool_modification.php

--- In flexcoders@yahoogroups.com, Fotis Chatzinikos  
wrote:
>
> Google ObjectHandles ;-)
> 
> On Thu, Sep 17, 2009 at 5:06 PM, flexaustin  wrote:
> 
> >
> >
> > Anyone ever create or see a tut/example on how to create resize/skew
> > handles on Sprites or UIComponents?
> >
> > Say you click a Sprite on screen, the sprite would should show a bounding
> > box, similar to Flash, Photoshop, Visio or Firefox, which allow you to make
> > the clicked Sprite wider, thinner, skew, or rotate the Sprite.
> >
> > TIA, J
> >
> >  
> >
> 
> 
> 
> -- 
> Fotis Chatzinikos, Ph.D.
> Founder,
> Phinnovation
> fotis.chatzini...@...,
>




[flexcoders] Re: Creating Resize Handles

2009-09-17 Thread ag_rcuren
This can be quite difficult depending on how robust you want it to be. I have 
built 2 different "Transform" tools to suit some specific needs I had but here 
is a link that should work for most people.

http://www.sephiroth.it/weblog/archives/2009/06/multiple_objects_using_senocular_tran.php

It is basically Senocular's transform manager, which is great, ported over to 
flex with some added extras.

If you want to go down the route of building your own I can provide you some 
example code I have, but I would also suggest looking at source code from the 
link above.

Good luck

--- In flexcoders@yahoogroups.com, "flexaustin"  wrote:
>
> Anyone ever create or see a tut/example on how to create resize/skew handles 
> on Sprites or UIComponents? 
> 
> Say you click a Sprite on screen, the sprite would should show a bounding 
> box, similar to Flash, Photoshop, Visio or Firefox, which allow you to make 
> the clicked Sprite wider, thinner, skew, or rotate the Sprite.
> 
> TIA, J
>