Im using scaling in an onEnterFrame to achieve a zoom in and out for an image thats being used in a 360 VR arrangement. (using its _x property to spin it left or right)
Seeing as the registration point of the movie clip with the image in it is in the centre of it, when it zooms in and out i need to correct the x position to compensate from the growing from the centrepoint so the image doesnt whizz past the viewing, window but instead stays focused on what you were looking at when you clicked zoom in.
on the zoom button in an on(release) set a var that points to where the x of the scaled up image should be once its finished in order to look like it hasnt moved. targetsize variable is something like 200 (the scale i want to zoom in), and halfOfStageWidth is exactly that.
on (release) {
Xforzooming = (this.image_mc._x*(this.targetsize/100))-(halfOfStageWidth);
}
}
then in the onEnterFrame that does the scaling i also use
this.image_mc._x += (this.Xforzooming-this.image_mc._x)/this.zoomacc;
zoomacc is something like 20, its used to ease the movement.
ok so this works fine - but how do i **reverse **this for zooming out. what should i set Xforzooming to when i click the zoom out button.
And what AS should i use to ease the _x in the oppisite direction? So that if i was to click zoom in and zoom out over and over it would appear as if nothings moved?