yeah that is what I was thinking too, and I started to write an
if/then for the code to grab it if it gets up to 179/-179 and then
switch it but it doesnt work. It seems kind of inefficient however,
there has to be another way.. I know that when I use .rotation = 
(whatever)  you can enter 540, for example, and it will rotate 1 1/2
times, so it is puzzling as heck.  I will give it a go. I posted just
the method that I call when the user tries to rotate.  

private function rotateImage():void
                {
                        //get global center points of object rotati0on
                        pt1 =  new Point(0,0);
                        pt1 = editingObj.localToGlobal(pt1);
                        trace(pt1)
                        pt1.x = pt1.x + (editingObj.width/2)
                        pt1.y = pt1.y + (editingObj.height/2);
                        
                
                // get angle of handle from center for radius bounds//
                        var dx1:Number = mouseDownPos.x- pt1.x;
                        var dy1:Number  = mouseDownPos.y- pt1.y;
                        var ang1:Number  = (Math.atan2(dy1, dx1)*180)/Math.PI;
                        
            // get angle of mouse from center //        
                        var dx2:Number  = Application.application.mouseX- pt1.x;
                        var dy2:Number  = Application.application.mouseY- pt1.y;
                        var ang2:Number  = (Math.atan2(dy2, dx2)*180)/Math.PI;
            // rotate the _target and stroke the difference of the two angles
 .001 is velocity//             
                        var angle:Number  = ((ang2-ang1)+ targetRotation )* .003
                        trace(angle);
                        var m:Matrix = editingObj.transform.matrix;
                        var boundM:Matrix = boundingBox.transform.matrix;
                        var thisM:Matrix = this.transform.matrix;
                        //send to rotator class
                        Rotation.rotateAroundInternalPoint(m, editingObj.width 
/ 2,
editingObj.height / 2, angle);
                        //Rotation.rotateAroundInternalPoint(thisM, this.width 
/ 2,
this.height / 2, angle);
                        //Rotation.rotateAroundInternalPoint(boundM, 
boundingBox.width / 2,
boundingBox.height / 2, angle);
                        //reset transform matrix
                        editingObj.transform.matrix = m;
                        //boundingBox.transform.matrix = m;
                        //this.transform.matrix = m;
                         
                        targetRotation = editingObj.rotation;
                        trace(targetRotation);
                        //setBoxesLocation();
                        renderBounding();
                        
                        
                }



--- In flexcoders@yahoogroups.com, Fotis Chatzinikos
<fotis.chatzini...@...> wrote:
>
> I am guessing here, but possibly rotations go from 0->180 or 0->-180
> 
> So maybe you need to do something like rotate up to 180 for example
and then
> switch to -179 and rotate back to 0 for a full circle...
> 
> If you try it , let as know...
> 
> On Sat, Feb 7, 2009 at 2:37 AM, Corey Smaller <corey_smal...@...>wrote:
> 
> >   hi, Im working on rotating an image simulating the Free
Transform tool
> > in Flash. I got it to rotate to 180 but then the image will not rotate
> > further. so basically it gets upside down and then fights me and
> > doesnt move. I have the source viewable on the example. the method is
> > in the WidgetEditor.as class -- rotate image and calls the Rotate.as
> > class to rotate it.
> > http://www.coreysmaller.com/test/ExchangeASClasses.html
> >
> > any help would be muy appreciated!
> > thanks
> > Corey
> >
> >  
> >
> 
> 
> 
> -- 
> Fotis Chatzinikos, Ph.D.
> Founder,
> Phinnovation
> fotis.chatzini...@...,
>


Reply via email to