Hello,
I’m trying to create Multitouch functionality to allow users to scale the height or width of a MovieClip (and drag and rotate). At the moment I’m using the Gestouch framework, which is great. It allows me to drag, rotate and scale. But the scale is uniform, whereas as I want the width and height to be scaled independently…
Here is the code I’m using
const gesture:TransformGesture = event.target as TransformGesture; var matrix:Matrix = _object.transform.matrix;
// Panning
matrix.translate(gesture.offsetX, gesture.offsetY);
if (_move)_object.transform.matrix = matrix;
if (gesture.scale != 1 || gesture.rotation != 0)
{
// Scale and rotation.
var transformPoint:Point = matrix.transformPoint(_object.globalToLocal(gesture.location));
matrix.translate(-transformPoint.x, -transformPoint.y);
if (_rotate) matrix.rotate(gesture.rotation);
if (_scale) matrix.scale(gesture.scale, gesture.scale);
matrix.translate(transformPoint.x, transformPoint.y);
_object.transform.matrix = matrix;
Thanks for your help!