# Zoom effect

**URL:** <https://forum.kirupa.com/t/zoom-effect/224255>\
**Category:** Uncategorized\
**Created:** [April 30, 2007, 5:09pm UTC](https://forum.kirupa.com/t/zoom-effect/224255 "2007-04-30T17:09:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)\
**Post date:** [April 30, 2007, 5:09pm UTC](https://forum.kirupa.com/t/zoom-effect/224255/1 "2007-04-30T17:09:48Z")

</div>

I have an image that I has has didfferent areas I want people to zoom in on. I need the area that is clicked on to be brought to the centre of the flash stage and then after that tween scaled by 200%.

I so far have this actionscript that brings the object to the centre of the flash stage.

```auto

import mx.transitions.Tween;
import mx.transitions.easing.*;

var xpos = 290-_xmouse;
var ypos = 320-_ymouse;

var xPosT:Tween = new Tween(kText, "_x", Regular.easeOut, 20, xpos, 1, true);
var yPosT:Tween = new Tween(kText, "_y", Regular.easeOut, 120,ypos, 1, true);

```

However, I am having problems with the scaling. If I use this

```auto

var xScaleT:Tween = new Tween(kText, "_xscale", Regular.easeOut, 100, 200, 1, true);
var yScaleT:Tween = new Tween(kText, "_yscale", Regular.easeOut, 100, 200, 1, true);

```

The selected area moves away from the centre of the stage due to the up-scaling.

Is there a way to scale an object about a different reference point rather than the upper left corner of the tweening movieclip. If I scaled it about the coordinates for the centre of the stage then the selected area would remain in the centre.

Or is there a better way to do a zoom effect?
