hi - working on a photographer’s portfolio and i need to apply the ever-so-popular user ability to zoom into a photo and then pan the image vertically to see the rest of the masked image.
i checked out the Image panning tutorial and that works great if you’re math is in reference to the stage, but when i change it to reference the mask it doesn’t work the same.
can someone help?
onEnterFrame = function () {
xPos = -(_xmouse * (container._width - Stage.width) / Stage.width)
yPos = -(_ymouse * (container._height - Stage.height) / Stage.height)
var xMover:Tween = new Tween(container, "_x", Elastic.easeOut, container._x, xPos, 5, true);
var yMover:Tween = new Tween(container, "_y", Elastic.easeOut, container._y, yPos, 5, true);
};
so there is the code i’m using. two things: 1) when you resize the stage it doesn’t work anymore and 2) i need to apply this to an image behind a mask, not just the entire stage: