# How to tween lines and drawTo?

**URL:** <https://forum.kirupa.com/t/how-to-tween-lines-and-drawto/179919>\
**Category:** Uncategorized\
**Created:** [February 23, 2006, 11:38pm UTC](https://forum.kirupa.com/t/how-to-tween-lines-and-drawto/179919 "2006-02-23T23:38:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bugiam](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@bugiam](https://forum.kirupa.com/u/bugiam)\
**Post date:** [February 23, 2006, 11:38pm UTC](https://forum.kirupa.com/t/how-to-tween-lines-and-drawto/179919/1 "2006-02-23T23:38:15Z")

</div>

ok, here we go. Want to tween some curve vars so i can turn this…:

i = 0;  
onEnterFrame = function () {  
i += 0.03;  
tempvar = 0;  
this.createEmptyMovieClip(“clip2”, 1);  
var temp = Math.random(50)+20\*Math.sin(i);  
with (this[“clip2”]) {  
tempvar += 0.3;  
lineStyle(1, 0x999900, 100);  
beginFill(0xFFFFFF, 30);  
moveTo( 600, 274 );  
curveTo(Math.sin(i)\*temp+540, Math.cos(i)\*temp+226+tempvar, Math.cos(i)\*temp+399, 306);  
curveTo(Math.sin(i)\*temp+130, Math.cos(i)\*temp+420-tempvar, Math.cos(i)\*temp-80, 350);  
lineTo(600,350);  
}  
};

into this:  
onEnterFrame = function () {  
i += 0.03;  
this.createEmptyMovieClip(“clip”, 0);  
var temp = 10\*Math.sin(i);  
with (this[“clip”]) {  
lineStyle(1, 0x999900, 100);  
beginFill(0xFFFFFF, 30);  
moveTo( 600, 91 );  
curveTo(Math.sin(i)\*temp+440, Math.cos(i)\*temp+86, Math.cos(i)\*temp+470, Math.cos(i)\*temp+180);  
curveTo(Math.sin(i)\*temp+130, Math.cos(i)\*temp+420, Math.cos(i)\*temp+40, 350);  
lineTo(600,350);  
}  
};

* * *

i was thinking about using tweens. for example

curveTo(Math.sin(i)\*temp+VAR\_GOES\_HERE, Math.cos(i)\*temp+226+tempvar, Math.cos(i)\*temp+399, 306);

and then tween it when i need to somehow with something like this:

new Tween(this, “VAR\_GOES\_HERE”, Regular.easeOut, VAR\_GOES\_HERE, 244, 10, false);

this is all done in AS, no MC’s.

get it my question? 🙂
