Hi Ramesh, Object Handles may be useful for you. I have used this library for rotating.
http://www.objecthandles.com/ http://code.google.com/p/flex-object-handles/ Thanks, Nagarjuna On Thu, Sep 6, 2012 at 8:06 PM, Ramesh Vavila <[email protected]>wrote: > > Hi Friends , > > I want to rotate the image on center registration point but i am > unable do it. below i am sending code which i tried to implement image > rotation . please tell me any thing wrong i did in this code ? > > > public var aroundPoint:Point; > public function clickHandler():void > { > aroundPoint = resetCenterPoint(draggableImg, draggableImg.width/2, > draggableImg.height/2); > rotate(draggableImg, 90,aroundPoint.x, aroundPoint.y); > } > public function resetCenterPoint(obj:DisplayObject, orgX:Number, > orgY:Number):Point > { > var m:Matrix = obj.transform.matrix; > var orgXY:Point = m.deltaTransformPoint(new Point(orgX, orgX)); > orgXY.x += m.tx; > orgXY.y += m.ty; > return orgXY; > } > public function rotate(obj:DisplayObject, angle:Number, aroundX:Number, > aroundY:Number):void > { > var m:Matrix = obj.transform.matrix; > //var orgXY:Point = resetCenterPoint(obj, obj.width/2, obj.height/2); > var cm:Matrix = new Matrix(1, 0, 0, 1, -aroundX, -aroundY); > m.concat(cm); > m.rotate(Math.PI * angle / 180); > var rcm:Matrix = new Matrix(1, 0, 0, 1, aroundX, aroundY); > m.concat(rcm); > obj.transform.matrix = m; > } > thanks in Advance > > ramesh v > > -- > You received this message because you are subscribed to the Google Groups > "Flex India Community" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/flex_india?hl=en. > -- You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.

