# Using Tween class

**URL:** <https://forum.kirupa.com/t/using-tween-class/312330>\
**Category:** Uncategorized\
**Created:** [July 30, 2010, 8:02pm UTC](https://forum.kirupa.com/t/using-tween-class/312330 "2010-07-30T20:02:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rserge](https://avatars.discourse-cdn.com/v4/letter/r/dc4da7/32.png) [@rserge](https://forum.kirupa.com/u/rserge)\
**Post date:** [July 30, 2010, 8:02pm UTC](https://forum.kirupa.com/t/using-tween-class/312330/1 "2010-07-30T20:02:20Z")

</div>

I received help earlier on getting the tween class syntax.  
I have one issue. Please see sample:  
[http://www.sergemedia.net/ds2/map/lissarazoomfix.html](http://www.sergemedia.net/ds2/map/lissarazoomfix.html)

Click on Lot 41 first when it loads.  
You will see the map snap to another position and tween from there, rather than its current location. If I move the zoom slider manually to 200% first then it tweens correctly. I was looking for a fix. Thank you.  
This only happens on the initial click of first lot (Lot 41 and 48 are coded) After that it tweens properly.

```auto

_root.map_mc.map_gra.lot41_btn.onRelease = function(){
	
    stopAllMCs();
	hideAllslides();
	_root.slide41_mc._visible=true
	_root.range41._visible=true;
    _root.map_mc.map_gra.lot41_btn.play();
	
_root.srchMC._visible=false;
	_root.info_mc._visible=true;
	_root.info_mc.gotoAndStop(41);
if (this.pressed) {

[COLOR="Red"]import mx.transitions.Tween;
import mx.transitions.easing.*;
var xmove41:Tween = new Tween(_root.map_mc, "_x", Regular.easeOut, _root.map_mc._x, (1250 - _root.map_mc.map_gra.lot41_btn._x), 2, true);
var Ymove41:Tween = new Tween(_root.map_mc, "_y", Regular.easeOut, _root.map_mc._y, (400 - _root.map_mc.map_gra.lot41_btn._y), 2, true);

} else {

var xmove41:Tween = new Tween(_root.map_mc, "_x", Regular.easeOut, _root.map_mc._x, (1250 - _root.map_mc.map_gra.lot41_btn._x), 2, true);
var Ymove41:Tween = new Tween(_root.map_mc, "_y", Regular.easeOut, _root.map_mc._y, (400 - _root.map_mc.map_gra.lot41_btn._y), 2, true);

}[/COLOR]
_root.map_mc._xscale=100;
_root.map_mc._yscale=100;
this.pressed = !this.pressed;

};

```
