# Tween Application help

**URL:** <https://forum.kirupa.com/t/tween-application-help/270294>\
**Category:** flash\
**Created:** [September 8, 2008, 1:15pm UTC](https://forum.kirupa.com/t/tween-application-help/270294 "2008-09-08T13:15:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyli51](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@kyli51](https://forum.kirupa.com/u/kyli51)\
**Post date:** [September 8, 2008, 1:15pm UTC](https://forum.kirupa.com/t/tween-application-help/270294/1 "2008-09-08T13:15:23Z")

</div>

hi all,

im quite new using tween class and is a little lost…

i want to use the tween class for my gallery, right now this is the code so when you pclick on a image then i “zoom”:  
what i want is to implement tween class so it will be smoother…any help ?

> var startX:Number = 0;  
> var startY:Number = 0;  
> var startW:Number = 0;  
> var startH:Number = 0;  
> var allowedH\_ToZoom:Number = 340;  
> var allowedW\_ToZoom:Number = 250;  
> var speed:Number = 1.5;  
> var endX:Number = 100;  
> var endY:Number = -5;  
> function zoomOutAnim()  
> {  
> if( product\_image.\_height \< allowedH\_ToZoom && product\_image.\_width \< allowedW\_ToZoom )  
> {  
> product\_image.\_width \*= 1.07;  
> product\_image.\_height \*= 1.07;  
> }  
> product\_image.\_x += ( endX - product\_image.\_x ) / speed  
> product\_image.\_y += ( endY - product\_image.\_y ) / speed;   
> product\_image.\_alpha += ( 100 - product\_image.\_alpha ) / speed  
> ExternalInterface.call(“console.debug”,"zooom out: “+ product\_image.\_alpha+” - “+product\_image.\_x+” - “+product\_image.\_y+” - “+product\_image.\_width+” - "+product\_image.\_height);  
> if(Math.round(product\_image.\_x) == endX && Math.round(product\_image.\_y) == endY)  
> {  
> clearInterval( zoom\_interval );  
> showHideOthers( true )  
> }

}
